Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
This commit is contained in:
parent
8e53a8e6fc
commit
656dcd4316
bin
games/pom
sbin
usr.bin
ar
calendar
chpass
find
finger
last
login
ruptime
script
vacation
w
@ -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]);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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 *
|
||||
|
@ -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]);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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" : "");
|
||||
|
Loading…
x
Reference in New Issue
Block a user