/[machmon]/machmon/linux/source/time.c
ViewVC logotype

Diff of /machmon/linux/source/time.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by pbastos, Tue Jul 9 14:48:59 2002 UTC revision 1.9 by clorets, Mon Jul 15 20:41:36 2002 UTC
# Line 70  d_date(void) Line 70  d_date(void)
70    
71          (void) time(&t);          (void) time(&t);
72          tm = *localtime(&t);          tm = *localtime(&t);
73          (void) strftime(buff, sizeof(buff), "%R, %d/%m/%Y %Z", &tm);          (void) strftime(buff, sizeof(buff), "%R, %m/%d/%Y %Z", &tm);
74    
75          output("~WSystem time: ~w%s\n", buff);          output("~WSystem time: ~w%s\n", buff);
76    
# Line 92  d_uptime(void) Line 92  d_uptime(void)
92    
93          while (fread((char *) &utmp_str, sizeof(utmp_str), 1, utmp_file) == 1)          while (fread((char *) &utmp_str, sizeof(utmp_str), 1, utmp_file) == 1)
94          {          {
95                  if (!strcmp(utmp_str.ut_name, "reboot"))                  if (!strcmp(utmp_str.ut_user, "reboot"))
96                          boottime = (time_t) utmp_str.ut_time;                          boottime = (time_t) utmp_str.ut_time;
97          }                          }
98    
99          if (!boottime)          if (!boottime)
100                  errx(1, "d_uptime");                  errx(1, "d_uptime");

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26