* win32_specific.c: Win32 specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: win32_specific.c,v 1.25 2003/09/29 17:36:35 gbazin Exp $
+ * $Id: win32_specific.c,v 1.28 2003/12/09 19:18:48 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
#endif
#if !defined( UNDER_CE )
+# include <io.h>
# include <fcntl.h>
# include <winsock2.h>
#endif
_fmode = _O_BINARY;
_setmode( _fileno( stdin ), _O_BINARY ); /* Needed for pipes */
+ /* Call mdate() once to make sure it is initialized properly */
+ mdate();
+
/* WinSock Library Init. */
if( !WSAStartup( MAKEWORD( 2, 0 ), &Data ) )
{
#ifndef ABOVE_NORMAL_PRIORITY_CLASS
# define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
#endif
- if( config_GetInt( p_this, "high-priority" ) &&
- !SetPriorityClass( GetCurrentProcess(),
- ABOVE_NORMAL_PRIORITY_CLASS ) )
+ if( config_GetInt( p_this, "high-priority" ) )
{
- if( !SetPriorityClass( GetCurrentProcess(),
- HIGH_PRIORITY_CLASS ) )
- msg_Dbg( p_this, "can't raise process priority" );
- else
+ if( SetPriorityClass( GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS )
+ || SetPriorityClass( GetCurrentProcess(), HIGH_PRIORITY_CLASS ) )
+ {
msg_Dbg( p_this, "raised process priority" );
+ }
+ else
+ {
+ msg_Dbg( p_this, "could not raise process priority" );
+ }
}
- else
- msg_Dbg( p_this, "raised process priority" );
if( config_GetInt( p_this, "one-instance" ) )
{