From 1c3be799b773031a21a1503048c324e13c068f8c Mon Sep 17 00:00:00 2001 From: ehouse Date: Wed, 31 Dec 2008 04:19:23 +0000 Subject: [PATCH] start counter for uptime at launch --- xwords4/relay/xwrelay.cpp | 4 +++- xwords4/relay/xwrelay_priv.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xwords4/relay/xwrelay.cpp b/xwords4/relay/xwrelay.cpp index eddeb87a8..8b3cdeba3 100644 --- a/xwords4/relay/xwrelay.cpp +++ b/xwords4/relay/xwrelay.cpp @@ -327,7 +327,7 @@ killSocket( int socket, const char* why ) } time_t -now() +now( void ) { static time_t startTime = time(NULL); return time(NULL) - startTime; @@ -524,6 +524,8 @@ main( int argc, char** argv ) bool doDaemon = true; bool doFork = true; + (void)now(); /* force capture of start time */ + /* Verify sizes here... */ assert( sizeof(CookieID) == 2 ); diff --git a/xwords4/relay/xwrelay_priv.h b/xwords4/relay/xwrelay_priv.h index 60ed6a2ca..02f0f55d6 100644 --- a/xwords4/relay/xwrelay_priv.h +++ b/xwords4/relay/xwrelay_priv.h @@ -21,7 +21,7 @@ void killSocket( int socket, const char* why ); bool send_with_length_unsafe( int socket, unsigned char* buf, int bufLen ); -time_t now(); +time_t now(void); int make_socket( unsigned long addr, unsigned short port );