diff options
author | wollman <wollman@FreeBSD.org> | 1995-08-07 19:17:46 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-08-07 19:17:46 +0000 |
commit | fc1f6c1d76677a4e8d2c39e5fa7be3716841930e (patch) | |
tree | 413738746625eee30af858d100ea794582067fa4 | |
parent | c87e4ea046fafb0b07c7ac3335948b0743fed8b4 (diff) | |
download | FreeBSD-src-fc1f6c1d76677a4e8d2c39e5fa7be3716841930e.zip FreeBSD-src-fc1f6c1d76677a4e8d2c39e5fa7be3716841930e.tar.gz |
Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
-rw-r--r-- | bin/ls/print.c | 5 | ||||
-rw-r--r-- | bin/pax/gen_subs.c | 5 | ||||
-rw-r--r-- | bin/ps/print.c | 7 | ||||
-rw-r--r-- | games/pom/pom.c | 2 | ||||
-rw-r--r-- | sbin/dump/optr.c | 10 | ||||
-rw-r--r-- | sbin/savecore/savecore.c | 3 | ||||
-rw-r--r-- | sbin/shutdown/shutdown.c | 1 | ||||
-rw-r--r-- | usr.bin/ar/contents.c | 1 | ||||
-rw-r--r-- | usr.bin/calendar/calendar.c | 6 | ||||
-rw-r--r-- | usr.bin/chpass/util.c | 9 | ||||
-rw-r--r-- | usr.bin/find/function.c | 9 | ||||
-rw-r--r-- | usr.bin/find/ls.c | 3 | ||||
-rw-r--r-- | usr.bin/finger/lprint.c | 3 | ||||
-rw-r--r-- | usr.bin/finger/sprint.c | 4 | ||||
-rw-r--r-- | usr.bin/last/last.c | 5 | ||||
-rw-r--r-- | usr.bin/login/login.c | 5 | ||||
-rw-r--r-- | usr.bin/ruptime/ruptime.c | 13 | ||||
-rw-r--r-- | usr.bin/script/script.c | 3 | ||||
-rw-r--r-- | usr.bin/vacation/vacation.c | 5 | ||||
-rw-r--r-- | usr.bin/w/pr_time.c | 17 | ||||
-rw-r--r-- | usr.bin/w/w.c | 11 |
21 files changed, 52 insertions, 75 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c index d0e6c16..03b9288 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: print.c,v 1.3 1995/03/19 13:28:46 joerg Exp $ + * $Id: print.c,v 1.4 1995/05/30 00:06:50 rgrimes Exp $ */ #ifndef lint @@ -52,7 +52,6 @@ static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94"; #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> @@ -234,7 +233,7 @@ printtime(ftime) for (i = 4; i < 11; ++i) (void)putchar(longstring[i]); -#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) +#define SIXMONTHS ((365 / 2) * 86400) if (f_sectime) for (i = 11; i < 24; i++) (void)putchar(longstring[i]); diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index 42be017..2d228fc 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: gen_subs.c,v 1.3 1995/03/19 13:28:49 joerg Exp $ + * $Id: gen_subs.c,v 1.4 1995/05/30 00:06:58 rgrimes Exp $ */ #ifndef lint @@ -47,7 +47,6 @@ static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93"; #include <sys/param.h> #include <stdio.h> #include <ctype.h> -#include <tzfile.h> #include <utmp.h> #include <unistd.h> #include <stdlib.h> @@ -64,7 +63,7 @@ static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93"; */ #define MODELEN 20 #define DATELEN 64 -#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) +#define SIXMONTHS ((365 / 2) * 86400) #define CURFRMT "%b %e %H:%M" #define OLDFRMT "%b %e %Y" #ifndef UT_NAMESIZE diff --git a/bin/ps/print.c b/bin/ps/print.c index 8085f48..cf042d7 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: print.c,v 1.6 1995/03/19 13:29:01 joerg Exp $ + * $Id: print.c,v 1.7 1995/05/30 00:07:04 rgrimes Exp $ */ #ifndef lint @@ -65,7 +65,6 @@ static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; #include <stdlib.h> #include <string.h> #include <vis.h> -#include <tzfile.h> #include "ps.h" @@ -369,11 +368,11 @@ started(k, ve) tp = localtime(&k->ki_u.u_start.tv_sec); if (!now) (void)time(&now); - if (now - k->ki_u.u_start.tv_sec < 24 * SECSPERHOUR) { + if (now - k->ki_u.u_start.tv_sec < 24 * 3600) { /* I *hate* SCCS... */ static char fmt[] = __CONCAT("%l:%", "M%p"); (void)strftime(buf, sizeof(buf) - 1, fmt, tp); - } else if (now - k->ki_u.u_start.tv_sec < 7 * SECSPERDAY) { + } else if (now - k->ki_u.u_start.tv_sec < 7 * 86400) { /* I *hate* SCCS... */ static char fmt[] = __CONCAT("%a%", "I%p"); (void)strftime(buf, sizeof(buf) - 1, fmt, tp); diff --git a/games/pom/pom.c b/games/pom/pom.c index 01fcf7d..e8ea17a 100644 --- a/games/pom/pom.c +++ b/games/pom/pom.c @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93"; #include <sys/time.h> #include <stdio.h> -#include <tzfile.h> #include <math.h> #define PI 3.141592654 @@ -66,6 +65,7 @@ static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93"; #define lzero 18.251907 /* lunar mean long at EPOCH */ #define Pzero 192.917585 /* lunar mean long of perigee at EPOCH */ #define Nzero 55.204723 /* lunar mean long of node at EPOCH */ +#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) double dtor(), potm(), adj360(); diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 303b5b3..3c464e4 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -44,19 +44,11 @@ static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; #include <grp.h> #include <signal.h> #include <stdio.h> -#ifdef __STDC__ #include <stdlib.h> #include <string.h> #include <stdarg.h> -#endif -#include <tzfile.h> -#ifdef __STDC__ #include <unistd.h> -#endif #include <utmp.h> -#ifndef __STDC__ -#include <varargs.h> -#endif #include "dump.h" #include "pathnames.h" @@ -511,7 +503,7 @@ lastdump(arg) dt = fstabsearch(dtwalk->dd_name); dumpme = (dt != NULL && dt->fs_freq != 0 && - dtwalk->dd_ddate < tnow - (dt->fs_freq * SECSPERDAY)); + dtwalk->dd_ddate < tnow - (dt->fs_freq * 86400)); if (arg != 'w' || dumpme) (void) printf( "%c %8s\t(%6s) Last dump: Level %c, Date %s\n", diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 40e2b37..67ea278 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -58,7 +58,6 @@ static char sccsid[] = "@(#)savecore.c 8.3 (Berkeley) 1/2/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #define ok(number) ((number) - KERNBASE) @@ -519,7 +518,7 @@ get_crashtime() return (0); } (void)printf("savecore: system went down at %s", ctime(&dumptime)); -#define LEEWAY (7 * SECSPERDAY) +#define LEEWAY (7 * 86400) if (dumptime < now - LEEWAY || dumptime > now + LEEWAY) { (void)printf("dump time is unreasonable\n"); return (0); diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c index 1e69eed..e94e096 100644 --- a/sbin/shutdown/shutdown.c +++ b/sbin/shutdown/shutdown.c @@ -54,7 +54,6 @@ static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "pathnames.h" diff --git a/usr.bin/ar/contents.c b/usr.bin/ar/contents.c index ffa4856..dc45b36 100644 --- a/usr.bin/ar/contents.c +++ b/usr.bin/ar/contents.c @@ -47,7 +47,6 @@ static char sccsid[] = "@(#)contents.c 8.3 (Berkeley) 4/2/94"; #include <fcntl.h> #include <stdio.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "archive.h" diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index c6e60dd..deb4cfc 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "pathnames.h" @@ -72,6 +71,7 @@ int isnow __P((char *)); FILE *opencal __P((void)); void settime __P((void)); void usage __P((void)); +#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) int main(argc, argv) @@ -172,10 +172,10 @@ settime() (void)time(&now); tp = localtime(&now); if (isleap(tp->tm_year + 1900)) { - yrdays = DAYSPERLYEAR; + yrdays = 366; cumdays = daytab[1]; } else { - yrdays = DAYSPERNYEAR; + yrdays = 365; cumdays = daytab[0]; } /* Friday displays Monday's events */ diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c index 8dfd388..fe89d79 100644 --- a/usr.bin/chpass/util.c +++ b/usr.bin/chpass/util.c @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94"; #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include "chpass.h" @@ -64,7 +63,7 @@ ttoa(tval) if (tval) { tp = localtime(&tval); (void)sprintf(tbuf, "%s %d, %d", months[tp->tm_mon], - tp->tm_mday, tp->tm_year + TM_YEAR_BASE); + tp->tm_mday, tp->tm_year + 1900); } else *tbuf = '\0'; @@ -109,10 +108,10 @@ atot(p, store) if (day < 1 || day > 31 || month < 1 || month > 12 || !year) goto bad; if (year < 100) - year += TM_YEAR_BASE; - if (year <= EPOCH_YEAR) + year += 1900; + if (year <= 1970) bad: return (1); - lt->tm_year = year - TM_YEAR_BASE; + lt->tm_year = year - 1900; lt->tm_mon = month - 1; lt->tm_mday = day; lt->tm_hour = 0; diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 72a4e74..6bd85b5 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -53,7 +53,6 @@ static char sccsid[] = "@(#)function.c 8.6 (Berkeley) 4/1/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "find.h" @@ -140,7 +139,7 @@ f_atime(plan, entry) extern time_t now; COMPARE((now - entry->fts_statp->st_atime + - SECSPERDAY - 1) / SECSPERDAY, plan->t_data); + 86400 - 1) / 86400, plan->t_data); } PLAN * @@ -170,7 +169,7 @@ f_ctime(plan, entry) extern time_t now; COMPARE((now - entry->fts_statp->st_ctime + - SECSPERDAY - 1) / SECSPERDAY, plan->t_data); + 86400 - 1) / 86400, plan->t_data); } PLAN * @@ -577,8 +576,8 @@ f_mtime(plan, entry) { extern time_t now; - COMPARE((now - entry->fts_statp->st_mtime + SECSPERDAY - 1) / - SECSPERDAY, plan->t_data); + COMPARE((now - entry->fts_statp->st_mtime + 86400 - 1) / + 86400, plan->t_data); } PLAN * diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c index dd51f97..929ef79 100644 --- a/usr.bin/find/ls.c +++ b/usr.bin/find/ls.c @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)ls.c 8.1 (Berkeley) 6/6/93"; #include <stdio.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> @@ -90,7 +89,7 @@ printtime(ftime) for (i = 4; i < 11; ++i) (void)putchar(longstring[i]); -#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) +#define SIXMONTHS ((365 / 2) * 86400) if (ftime + SIXMONTHS > time((time_t *)NULL)) for (i = 11; i < 16; ++i) (void)putchar(longstring[i]); diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c index 51e0f96..28a9be7 100644 --- a/usr.bin/finger/lprint.c +++ b/usr.bin/finger/lprint.c @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)lprint.c 8.1 (Berkeley) 6/6/93"; #include <sys/time.h> #include <fcntl.h> #include <time.h> -#include <tzfile.h> #include <db.h> #include <pwd.h> #include <utmp.h> @@ -207,7 +206,7 @@ lprint(pn) tp = localtime(&w->loginat); t = asctime(tp); tzn = tp->tm_zone; - if (now - w->loginat > SECSPERDAY * DAYSPERNYEAR / 2) + if (now - w->loginat > 86400 * 365 / 2) cpr = printf("Last login %.16s %.4s (%s) on %s", t, t + 20, tzn, w->tty); diff --git a/usr.bin/finger/sprint.c b/usr.bin/finger/sprint.c index a6481cd..fdb3b6c 100644 --- a/usr.bin/finger/sprint.c +++ b/usr.bin/finger/sprint.c @@ -41,7 +41,6 @@ static char sccsid[] = "@(#)sprint.c 8.1 (Berkeley) 6/6/93"; #include <sys/types.h> #include <sys/time.h> #include <time.h> -#include <tzfile.h> #include <db.h> #include <pwd.h> #include <errno.h> @@ -117,6 +116,9 @@ sflag_print() } else (void)printf(" * "); p = ctime(&w->loginat); +#define SECSPERDAY 86400 +#define DAYSPERWEEK 7 +#define DAYSPERNYEAR 365 if (now - w->loginat < SECSPERDAY * (DAYSPERWEEK - 1)) (void)printf("%.3s ", p); else diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 662a663..1d18600 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -52,7 +52,6 @@ static char sccsid[] = "@(#)last.c 8.2 (Berkeley) 4/2/94"; #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> @@ -248,12 +247,12 @@ wtmp() printf("- %5.5s", ctime(&T->logout)+11); delta = T->logout - bp->ut_time; - if (delta < SECSPERDAY) + if (delta < 86400) printf(" (%5.5s)\n", asctime(gmtime(&delta))+11); else printf(" (%ld+%5.5s)\n", - delta / SECSPERDAY, + delta / 86400, asctime(gmtime(&delta))+11); } if (maxrec != -1 && !--maxrec) diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index b8bf1f6..f3f9ae6 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -64,7 +64,6 @@ static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94"; #include <string.h> #include <syslog.h> #include <ttyent.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> @@ -366,7 +365,7 @@ main(argc, argv) (void)printf("Sorry -- your password has expired.\n"); changepass=1; } else if (pwd->pw_change - tp.tv_sec < - 2 * DAYSPERWEEK * SECSPERDAY && !quietlog) + 2 * 7 * 86400 && !quietlog) (void)printf("Warning: your password expires on %s", ctime(&pwd->pw_change)); if (pwd->pw_expire) @@ -374,7 +373,7 @@ main(argc, argv) (void)printf("Sorry -- your account has expired.\n"); sleepexit(1); } else if (pwd->pw_expire - tp.tv_sec < - 2 * DAYSPERWEEK * SECSPERDAY && !quietlog) + 2 * 7 * 86400 && !quietlog) (void)printf("Warning: your account expires on %s", ctime(&pwd->pw_expire)); diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c index 24e2021..ba8cda5 100644 --- a/usr.bin/ruptime/ruptime.c +++ b/usr.bin/ruptime/ruptime.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id$ */ +/* $Id: ruptime.c,v 1.4 1995/07/22 22:28:31 joerg Exp $ */ #ifndef lint static char copyright[] = @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)ruptime.c 8.2 (Berkeley) 4/5/94"; #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> struct hs { @@ -203,11 +202,11 @@ interval(tval, updown) return (resbuf); } /* round to minutes. */ - minutes = (tval + (SECSPERMIN - 1)) / SECSPERMIN; - hours = minutes / MINSPERHOUR; - minutes %= MINSPERHOUR; - days = hours / HOURSPERDAY; - hours %= HOURSPERDAY; + minutes = (tval + (60 - 1)) / 60; + hours = minutes / 60; + minutes %= 60; + days = hours / 24; + hours %= 24; if (days) (void)snprintf(resbuf, sizeof(resbuf), "%s %2d+%02d:%02d", updown, days, hours, minutes); diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index e688d64..25c5ad6 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #include <stdlib.h> #include <string.h> #include <termios.h> -#include <tzfile.h> #include <unistd.h> FILE *fscript; @@ -171,7 +170,7 @@ dooutput() (void)fprintf(fscript, "Script started on %s", ctime(&tvec)); (void)signal(SIGALRM, scriptflush); - value.it_interval.tv_sec = SECSPERMIN / 2; + value.it_interval.tv_sec = 60 / 2; value.it_interval.tv_usec = 0; value.it_value = value.it_interval; (void)setitimer(ITIMER_REAL, &value, NULL); diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index 025eb98..ae549c8 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -54,7 +54,6 @@ static char sccsid[] = "@(#)vacation.c 8.2 (Berkeley) 1/26/94"; #include <db.h> #include <time.h> #include <syslog.h> -#include <tzfile.h> #include <errno.h> #include <unistd.h> #include <stdio.h> @@ -114,7 +113,7 @@ main(argc, argv) break; case 'r': if (isdigit(*optarg)) { - interval = atol(optarg) * SECSPERDAY; + interval = atol(optarg) * 86400; if (interval < 0) usage(); } @@ -319,7 +318,7 @@ recent() key.data = VIT; key.size = sizeof(VIT); if ((db->get)(db, &key, &data, 0)) - next = SECSPERDAY * DAYSPERWEEK; + next = 86400 * 7; else bcopy(data.data, &next, sizeof(next)); diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 91410ee..ba94b50 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -40,7 +40,6 @@ static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94"; #include <stdio.h> #include <string.h> -#include <tzfile.h> #include "extern.h" @@ -64,11 +63,11 @@ pr_attime(started, now) diff = *now - *started; /* If more than a week, use day-month-year. */ - if (diff > SECSPERDAY * DAYSPERWEEK) + if (diff > 86400 * 7) (void)strcpy(fmt, "%d%b%y"); /* If not today, use day-hour-am/pm. */ - else if (*now / SECSPERDAY != *started / SECSPERDAY) { + else if (*now / 86400 != *started / 86400) { (void)strcpy(fmt, __CONCAT("%a%", "I%p")); } @@ -90,18 +89,18 @@ pr_idle(idle) time_t idle; { /* If idle more than 36 hours, print as a number of days. */ - if (idle >= 36 * SECSPERHOUR) - (void)printf(" %ddays ", idle / SECSPERDAY); + if (idle >= 36 * 3600) + (void)printf(" %ddays ", idle / 86400); /* If idle more than an hour, print as HH:MM. */ - else if (idle >= SECSPERHOUR) + else if (idle >= 3600) (void)printf(" %2d:%02d ", - idle / SECSPERHOUR, (idle % SECSPERHOUR) / SECSPERMIN); + idle / 3600, (idle % 3600) / 60); - else if (idle / SECSPERMIN == 0) + else if (idle / 60 == 0) (void)printf(" - "); /* Else print the minutes idle. */ else - (void)printf(" %2d ", idle / SECSPERMIN); + (void)printf(" %2d ", idle / 60); } diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 6e006ad..e7cafca 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -72,7 +72,6 @@ static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> #include <vis.h> @@ -371,11 +370,11 @@ pr_header(nowp, nusers) boottime.tv_sec != 0) { uptime = now - boottime.tv_sec; uptime += 30; - days = uptime / SECSPERDAY; - uptime %= SECSPERDAY; - hrs = uptime / SECSPERHOUR; - uptime %= SECSPERHOUR; - mins = uptime / SECSPERMIN; + days = uptime / 86400; + uptime %= 86400; + hrs = uptime / 3600; + uptime %= 3600; + mins = uptime / 60; (void)printf(" up"); if (days > 0) (void)printf(" %d day%s,", days, days > 1 ? "s" : ""); |