]> git.sesse.net Git - vlc/blobdiff - src/misc/win32_specific.c
* src/misc/mtime.c: fixed an overflow in mdate() on win32.
[vlc] / src / misc / win32_specific.c
index f6c5f50aa715a860fbd120b8b06bf6ac5368ee43..7afacde49a63832d41bdc779d92e01acdb02f3ac 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
@@ -32,6 +32,7 @@
 #endif
 
 #if !defined( UNDER_CE )
+#   include <io.h>
 #   include <fcntl.h>
 #   include <winsock2.h>
 #endif
@@ -71,6 +72,9 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
     _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 ) )
     {
@@ -126,18 +130,18 @@ void system_Configure( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
 #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" ) )
     {