[ScryMUD] SVN Commit Info r884 - trunk/mud/grrmud/server

scrymud at wanfear.com scrymud at wanfear.com
Sun Feb 18 22:24:40 PST 2007


Author: eroper
Date: 2007-02-18 22:24:40 -0800 (Sun, 18 Feb 2007)
New Revision: 884

Modified:
   trunk/mud/grrmud/server/grrmud.cc
Log:
Removed the unused variable "init" from game_loop() and fixed an instance
of gettimeofday() being passed a timezone struct. That shouldn't ever
happen.


Modified: trunk/mud/grrmud/server/grrmud.cc
===================================================================
--- trunk/mud/grrmud/server/grrmud.cc	2007-02-18 22:13:24 UTC (rev 883)
+++ trunk/mud/grrmud/server/grrmud.cc	2007-02-19 06:24:40 UTC (rev 884)
@@ -745,7 +745,6 @@
    fd_set input_set, output_set, exc_set;
    struct timeval last_time, now, timespent, timeout, null_time;
    struct timeval time_since_pulse;
-   struct timezone init;
    static struct timeval opt_time;
    Cell<critter*> pc_cell;
    critter* pc_ptr;
@@ -772,7 +771,9 @@
    opt_time.tv_usec = config.optUsec;  /* Init time values */
    opt_time.tv_sec = 0;
    
-   gettimeofday(&last_time, NULL);  // was &init
+   // see the manpage, gettimeofday() should always be passed NULL for
+   // struct timezone *tz
+   gettimeofday(&last_time, NULL);
 
    avail_descs = config.maxPlayers;
 
@@ -820,7 +821,7 @@
 
       //log("check out the time.\n");
 
-      gettimeofday(&now, &init);
+      gettimeofday(&now, NULL);
       timespent = timediff(&now, &last_time);
       timeout = timediff(&opt_time, &timespent);
       last_time.tv_sec = now.tv_sec + timeout.tv_sec;




More information about the ScryMUD mailing list