server: Initialize current_time before it's used in init_registry.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-04-06 17:20:58 +02:00 committed by Alexandre Julliard
parent fc1cc8ef78
commit 9bfbb48662
3 changed files with 3 additions and 1 deletions

View File

@ -372,7 +372,7 @@ struct timeout_user
static struct list timeout_list = LIST_INIT(timeout_list); /* sorted timeouts list */ static struct list timeout_list = LIST_INIT(timeout_list); /* sorted timeouts list */
timeout_t current_time; timeout_t current_time;
static inline void set_current_time(void) void set_current_time(void)
{ {
static const timeout_t ticks_1601_to_1970 = (timeout_t)86400 * (369 * 365 + 89) * TICKS_PER_SEC; static const timeout_t ticks_1601_to_1970 = (timeout_t)86400 * (369 * 365 + 89) * TICKS_PER_SEC;
struct timeval now; struct timeval now;

View File

@ -134,6 +134,7 @@ extern timeout_t current_time;
typedef void (*timeout_callback)( void *private ); typedef void (*timeout_callback)( void *private );
extern void set_current_time( void );
extern struct timeout_user *add_timeout_user( timeout_t when, timeout_callback func, void *private ); extern struct timeout_user *add_timeout_user( timeout_t when, timeout_callback func, void *private );
extern void remove_timeout_user( struct timeout_user *user ); extern void remove_timeout_user( struct timeout_user *user );
extern const char *get_timeout_str( timeout_t timeout ); extern const char *get_timeout_str( timeout_t timeout );

View File

@ -141,6 +141,7 @@ int main( int argc, char *argv[] )
open_master_socket(); open_master_socket();
if (debug_level) fprintf( stderr, "wineserver: starting (pid=%ld)\n", (long) getpid() ); if (debug_level) fprintf( stderr, "wineserver: starting (pid=%ld)\n", (long) getpid() );
set_current_time();
init_signals(); init_signals();
init_directories(); init_directories();
init_registry(); init_registry();