diff --git a/dlls/dmscript/script.c b/dlls/dmscript/script.c index d7c696b..3837d10 100644 --- a/dlls/dmscript/script.c +++ b/dlls/dmscript/script.c @@ -497,7 +497,7 @@ static HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_Load (LPPERSISTSTREA WideCharToMultiByte(CP_ACP, 0, This->pwzSource, -1, str, count, NULL, NULL); str[count-1] = '\n'; TRACE("source:\n"); - write( 2, str, count ); + write( STDERR_FILENO, str, count ); HeapFree(GetProcessHeap(), 0, str); } break; diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 34994af..3a75a1d 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -261,7 +261,7 @@ BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur ) { static const char beep = '\a'; /* dwFreq and dwDur are ignored by Win95 */ - if (isatty(2)) write( 2, &beep, 1 ); + if (isatty(STDERR_FILENO)) write( STDERR_FILENO, &beep, 1 ); return TRUE; } diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c index 6ed6086..e98d894 100644 --- a/dlls/msvcrt/errno.c +++ b/dlls/msvcrt/errno.c @@ -241,11 +241,11 @@ void CDECL MSVCRT_perror(const char* str) if (str && *str) { - MSVCRT__write( 2, str, strlen(str) ); - MSVCRT__write( 2, ": ", 2 ); + MSVCRT__write( MSVCRT_STDERR_FILENO, str, strlen(str) ); + MSVCRT__write( MSVCRT_STDERR_FILENO, ": ", 2 ); } - MSVCRT__write( 2, MSVCRT__sys_errlist[err], strlen(MSVCRT__sys_errlist[err]) ); - MSVCRT__write( 2, "\n", 1 ); + MSVCRT__write( MSVCRT_STDERR_FILENO, MSVCRT__sys_errlist[err], strlen(MSVCRT__sys_errlist[err]) ); + MSVCRT__write( MSVCRT_STDERR_FILENO, "\n", 1 ); } /****************************************************************************** diff --git a/dlls/ntdll/debugtools.c b/dlls/ntdll/debugtools.c index cb08285..1f0994e 100644 --- a/dlls/ntdll/debugtools.c +++ b/dlls/ntdll/debugtools.c @@ -143,7 +143,7 @@ static int NTDLL_dbg_vprintf( const char *format, va_list args ) else { char *pos = info->output; - write( 2, pos, info->out_pos + end - pos ); + write( STDERR_FILENO, pos, info->out_pos + end - pos ); /* move beginning of next line to start of buffer */ memmove( pos, info->out_pos + end, ret - end ); info->out_pos = pos + ret - end; diff --git a/libs/wine/debug.c b/libs/wine/debug.c index 12dbeb8..363e1e9 100644 --- a/libs/wine/debug.c +++ b/libs/wine/debug.c @@ -26,6 +26,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H +# include +#endif #include "wine/debug.h" #include "wine/library.h" @@ -177,7 +180,7 @@ static void debug_usage(void) "Example: WINEDEBUG=+all,warn-heap\n" " turns on all messages except warning heap messages\n" "Available message classes: err, warn, fixme, trace\n"; - write( 2, usage, sizeof(usage) - 1 ); + write( STDERR_FILENO, usage, sizeof(usage) - 1 ); exit(1); } diff --git a/loader/preloader.c b/loader/preloader.c index 1143972..1b9b1b2 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -419,7 +419,7 @@ static __attribute__((format(printf,1,2))) void wld_printf(const char *fmt, ... va_start( args, fmt ); len = wld_vsprintf(buffer, fmt, args ); va_end( args ); - wld_write(2, buffer, len); + wld_write(STDERR_FILENO, buffer, len); } static __attribute__((noreturn,format(printf,1,2))) void fatal_error(const char *fmt, ... ) @@ -431,7 +431,7 @@ static __attribute__((noreturn,format(printf,1,2))) void fatal_error(const char va_start( args, fmt ); len = wld_vsprintf(buffer, fmt, args ); va_end( args ); - wld_write(2, buffer, len); + wld_write(STDERR_FILENO, buffer, len); wld_exit(1); }