[vlc-commits] Use STD*_FILENO constants where applicable

Rémi Denis-Courmont git at videolan.org
Sat Aug 4 11:46:03 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug  4 12:43:56 2012 +0300| [83a11816bc0b6c259e8ba0f455d9ab1eac8a15ae] | committer: Rémi Denis-Courmont

Use STD*_FILENO constants where applicable

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=83a11816bc0b6c259e8ba0f455d9ab1eac8a15ae
---

 bin/override.c               |    3 ++-
 bin/winvlc.c                 |    2 +-
 modules/access_output/file.c |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/bin/override.c b/bin/override.c
index b216dfe..fb4608c 100644
--- a/bin/override.c
+++ b/bin/override.c
@@ -39,6 +39,7 @@ void vlc_enable_override (void);
 #include <pthread.h>
 #ifdef HAVE_EXECINFO_H
 # include <execinfo.h>
+# include <unistd.h>
 #endif
 #ifdef NDEBUG
 # undef HAVE_BACKTRACE
@@ -75,7 +76,7 @@ static void vlogbug (unsigned *pc, const char *level, const char *func,
         fputs (")\n", stderr);
         fflush (stderr);
 #ifdef HAVE_BACKTRACE
-        backtrace_symbols_fd (framev + 2, framec - 2, fileno (stderr));
+        backtrace_symbols_fd (framev + 2, framec - 2, STDERR_FILENO);
 #endif
     }
     funlockfile (stderr);
diff --git a/bin/winvlc.c b/bin/winvlc.c
index e86fe75..9db5df1 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -196,7 +196,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
         SetUnhandledExceptionFilter(vlc_exception_filter);
     }
 
-    _setmode( _fileno( stdin ), _O_BINARY ); /* Needed for pipes */
+    _setmode( STDIN_FILENO, _O_BINARY ); /* Needed for pipes */
 
 #else /* UNDER_CE */
     char **argv, psz_cmdline[wcslen(lpCmdLine) * 4];
diff --git a/modules/access_output/file.c b/modules/access_output/file.c
index 0ae8ffb..3ee0e8c 100644
--- a/modules/access_output/file.c
+++ b/modules/access_output/file.c
@@ -139,9 +139,9 @@ static int Open( vlc_object_t *p_this )
     if( !strcmp( p_access->psz_path, "-" ) )
     {
 #if defined( WIN32 ) || defined( __OS2__ )
-        setmode (fileno (stdout), O_BINARY);
+        setmode (STDOUT_FILENO, O_BINARY);
 #endif
-        fd = vlc_dup (fileno (stdout));
+        fd = vlc_dup (STDOUT_FILENO);
         if (fd == -1)
         {
             msg_Err (p_access, "cannot use standard output: %m");



More information about the vlc-commits mailing list