From c3dbbbabdf7c1b6b8d7fe43ade44b555671e1c67 Mon Sep 17 00:00:00 2001 From: dillon Date: Sat, 19 Jan 2002 23:20:02 +0000 Subject: I've been meaning to do this for a while. Add an underscore to the time_to_xxx() and xxx_to_time() functions. e.g. _time_to_xxx() instead of time_to_xxx(), to make it more obvious that these are stopgap functions & placemarkers and not meant to create a defacto standard. They will eventually be replaced when a real standard comes out of committee. --- usr.sbin/ac/ac.c | 4 ++-- usr.sbin/lastlogin/lastlogin.c | 2 +- usr.sbin/rwhod/rwhod.c | 8 ++++---- usr.sbin/tcpdump/tcpslice/tcpslice.c | 8 ++++---- usr.sbin/yppoll/yppoll.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/ac/ac.c b/usr.sbin/ac/ac.c index 1543568..e4dab9d 100644 --- a/usr.sbin/ac/ac.c +++ b/usr.sbin/ac/ac.c @@ -473,7 +473,7 @@ ac(fp) if (!FirstTime) FirstTime = usr.ut_time; if (Flags & AC_D) { - time_t t = int_to_time(usr.ut_time); + time_t t = _int_to_time(usr.ut_time); ltm = localtime(&t); if (day >= 0 && day != ltm->tm_yday) { day = ltm->tm_yday; @@ -525,7 +525,7 @@ ac(fp) (void)strcpy(usr.ut_line, "~"); if (Flags & AC_D) { - time_t t = int_to_time(usr.ut_time); + time_t t = _int_to_time(usr.ut_time); ltm = localtime(&t); if (day >= 0 && day != ltm->tm_yday) { /* diff --git a/usr.sbin/lastlogin/lastlogin.c b/usr.sbin/lastlogin/lastlogin.c index df8faca..29ef1cb 100644 --- a/usr.sbin/lastlogin/lastlogin.c +++ b/usr.sbin/lastlogin/lastlogin.c @@ -116,7 +116,7 @@ output(p, l) struct passwd *p; struct lastlog *l; { - time_t t = int_to_time(l->ll_time); + time_t t = _int_to_time(l->ll_time); printf("%-*.*s %-*.*s %-*.*s %s", UT_NAMESIZE, UT_NAMESIZE, p->pw_name, UT_LINESIZE, UT_LINESIZE, l->ll_line, diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 88e85bc..3e521fd 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -327,7 +327,7 @@ main(argc, argv) } #endif (void) time(&t); - wd.wd_recvtime = time_to_int(t); + wd.wd_recvtime = _time_to_int(t); (void) write(whod, (char *)&wd, cc); if (fstat(whod, &st) < 0 || st.st_size > cc) ftruncate(whod, cc); @@ -464,7 +464,7 @@ onalrm(signo) for (i = 0; i < 3; i++) mywd.wd_loadav[i] = htonl((u_long)(avenrun[i] * 100)); cc = (char *)we - (char *)&mywd; - mywd.wd_sendtime = htonl(time_to_time32(time(NULL))); + mywd.wd_sendtime = htonl(_time_to_time32(time(NULL))); mywd.wd_vers = WHODVERSION; mywd.wd_type = WHODTYPE_STATUS; if (multicast_mode == SCOPED_MULTICAST) { @@ -514,7 +514,7 @@ getboottime(signo) syslog(LOG_ERR, "cannot get boottime: %m"); exit(1); } - mywd.wd_boottime = htonl(time_to_time32(tm.tv_sec)); + mywd.wd_boottime = htonl(_time_to_time32(tm.tv_sec)); } void @@ -702,7 +702,7 @@ Sendto(s, buf, cc, flags, to, tolen) ntohl(w->wd_loadav[2]) / 100.0); cc -= WHDRSIZE; for (we = w->wd_we, cc /= sizeof(struct whoent); cc > 0; cc--, we++) { - time_t t = time32_to_time(ntohl(we->we_utmp.out_time)); + time_t t = _time32_to_time(ntohl(we->we_utmp.out_time)); printf("%-8.8s %s:%s %.12s", we->we_utmp.out_name, w->wd_hostname, we->we_utmp.out_line, diff --git a/usr.sbin/tcpdump/tcpslice/tcpslice.c b/usr.sbin/tcpdump/tcpslice/tcpslice.c index 46fa549..adca2f5 100644 --- a/usr.sbin/tcpdump/tcpslice/tcpslice.c +++ b/usr.sbin/tcpdump/tcpslice/tcpslice.c @@ -195,7 +195,7 @@ long local_time_zone(long timestamp) struct timeval now; struct timezone tz; long localzone; - time_t t = long_to_time(timestamp); + time_t t = _long_to_time(timestamp); if (gettimeofday(&now, &tz) < 0) err(1, "gettimeofday"); @@ -215,7 +215,7 @@ long local_time_zone(long timestamp) struct timeval parse_time(char *time_string, struct timeval base_time) { - time_t tt = long_to_time(base_time.tv_sec); + time_t tt = _long_to_time(base_time.tv_sec); struct tm *bt = localtime(&tt); struct tm t; struct timeval result; @@ -574,14 +574,14 @@ timestamp_to_string(struct timeval *timestamp) break; case TIMESTAMP_READABLE: - tt = long_to_time(timestamp->tv_sec); + tt = _long_to_time(timestamp->tv_sec); t = localtime(&tt); strcpy( buf, asctime( t ) ); buf[24] = '\0'; /* nuke final newline */ break; case TIMESTAMP_PARSEABLE: - tt = long_to_time(timestamp->tv_sec); + tt = _long_to_time(timestamp->tv_sec); t = localtime(&tt); if (t->tm_year >= 100) t->tm_year += 1900; diff --git a/usr.sbin/yppoll/yppoll.c b/usr.sbin/yppoll/yppoll.c index b473c71..207152c 100644 --- a/usr.sbin/yppoll/yppoll.c +++ b/usr.sbin/yppoll/yppoll.c @@ -88,7 +88,7 @@ char **argv; r = yp_order(domainname, inmap, &order); if (r != 0) errx(1, "no such map %s. Reason: %s", inmap, yperr_string(r)); - t = int_to_time(order); + t = _int_to_time(order); printf("Map %s has order number %d. %s", inmap, order, ctime(&t)); r = yp_master(domainname, inmap, &master); if (r != 0) -- cgit v1.1