diff options
author | 2013-12-03 01:32:49 +0000 | |
---|---|---|
committer | 2013-12-03 01:32:49 +0000 | |
commit | e79e306285af588019b14bb4031379f450685a93 (patch) | |
tree | 8b87ce42e8c0f03603295cfef649064dedb96f71 | |
parent | use LOGIN_NAME_MAX instead of L_cuserid, and adjust .h includes; ok millert (diff) | |
download | wireguard-openbsd-e79e306285af588019b14bb4031379f450685a93.tar.xz wireguard-openbsd-e79e306285af588019b14bb4031379f450685a93.zip |
Kill usage of timeb.h for upcoming removal of libcompat. OK deraadt@
-rw-r--r-- | gnu/usr.bin/cvs/config.h.in | 3 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/configure | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/configure.in | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/emx/config.h | 3 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/lib/getdate.c | 75 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/lib/getdate.y | 75 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/lib/xtime.h | 19 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/os2/config.h | 3 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/client.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/cvs.h | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/history.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/main.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/rcs.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/server.c | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/subr.c | 3 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/vms/config.h | 4 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/config.h | 3 |
17 files changed, 75 insertions, 129 deletions
diff --git a/gnu/usr.bin/cvs/config.h.in b/gnu/usr.bin/cvs/config.h.in index 986998f0712..41f7052b232 100644 --- a/gnu/usr.bin/cvs/config.h.in +++ b/gnu/usr.bin/cvs/config.h.in @@ -302,9 +302,6 @@ /* Define if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the <sys/timeb.h> header file. */ -#undef HAVE_SYS_TIMEB_H - /* Define if you have the <syslog.h> header file. */ #undef HAVE_SYSLOG_H diff --git a/gnu/usr.bin/cvs/configure b/gnu/usr.bin/cvs/configure index 954721dd9ba..3dec4059d30 100644 --- a/gnu/usr.bin/cvs/configure +++ b/gnu/usr.bin/cvs/configure @@ -2323,7 +2323,7 @@ fi for ac_hdr in errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \ limits.h sys/file.h \ - sys/param.h sys/select.h sys/time.h sys/timeb.h \ + sys/param.h sys/select.h sys/time.h \ io.h direct.h sys/bsdtypes.h sys/resource.h syslog.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` diff --git a/gnu/usr.bin/cvs/configure.in b/gnu/usr.bin/cvs/configure.in index 0f6cc741dc5..ebabc1b4347 100644 --- a/gnu/usr.bin/cvs/configure.in +++ b/gnu/usr.bin/cvs/configure.in @@ -79,7 +79,7 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \ limits.h sys/file.h \ - sys/param.h sys/select.h sys/time.h sys/timeb.h \ + sys/param.h sys/select.h sys/time.h \ io.h direct.h sys/bsdtypes.h sys/resource.h syslog.h) AC_HEADER_STAT AC_HEADER_TIME diff --git a/gnu/usr.bin/cvs/emx/config.h b/gnu/usr.bin/cvs/emx/config.h index 380e73e4e19..a0887ba8774 100644 --- a/gnu/usr.bin/cvs/emx/config.h +++ b/gnu/usr.bin/cvs/emx/config.h @@ -211,9 +211,6 @@ /* Define if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 -/* Define if you have the <sys/timeb.h> header file. */ -#define HAVE_SYS_TIMEB_H 1 - /* Define if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 diff --git a/gnu/usr.bin/cvs/lib/getdate.c b/gnu/usr.bin/cvs/lib/getdate.c index a94d7ed3def..65da187b818 100644 --- a/gnu/usr.bin/cvs/lib/getdate.c +++ b/gnu/usr.bin/cvs/lib/getdate.c @@ -1899,59 +1899,50 @@ difftm (a, b) } time_t -get_date(p, now) - char *p; - struct timeb *now; +get_date(p) + char *p; { - struct tm *tm, gmt; - struct timeb ftz; + struct tm *tm, *gmt, gmtbuf; time_t Start; time_t tod; - time_t nowtime; + time_t now; + time_t timezone; yyInput = p; - if (now == NULL) { - struct tm *gmt_ptr; + (void)time (&now); - now = &ftz; - (void)time (&nowtime); - - gmt_ptr = gmtime (&nowtime); - if (gmt_ptr != NULL) - { - /* Make a copy, in case localtime modifies *tm (I think - that comment now applies to *gmt_ptr, but I am too - lazy to dig into how gmtime and locatime allocate the - structures they return pointers to). */ - gmt = *gmt_ptr; - } + gmt = gmtime (&now); + if (gmt != NULL) + { + /* Make a copy, in case localtime modifies *tm (I think + that comment now applies to *gmt, but I am too + lazy to dig into how gmtime and locatime allocate the + structures they return pointers to). */ + gmtbuf = *gmt; + gmt = &gmtbuf; + } - if (! (tm = localtime (&nowtime))) - return -1; + if (! (tm = localtime (&now))) + return -1; - if (gmt_ptr != NULL) - ftz.timezone = difftm (&gmt, tm) / 60; - else - /* We are on a system like VMS, where the system clock is - in local time and the system has no concept of timezones. - Hopefully we can fake this out (for the case in which the - user specifies no timezone) by just saying the timezone - is zero. */ - ftz.timezone = 0; - - if(tm->tm_isdst) - ftz.timezone += 60; - } + if (gmt != NULL) + timezone = difftm (gmt, tm) / 60; else - { - nowtime = now->time; - } + /* We are on a system like VMS, where the system clock is + in local time and the system has no concept of timezones. + Hopefully we can fake this out (for the case in which the + user specifies no timezone) by just saying the timezone + is zero. */ + timezone = 0; + + if(tm->tm_isdst) + timezone += 60; - tm = localtime(&nowtime); + tm = localtime(&now); yyYear = tm->tm_year + 1900; yyMonth = tm->tm_mon + 1; yyDay = tm->tm_mday; - yyTimezone = now->timezone; + yyTimezone = timezone; yyDSTmode = DSTmaybe; yyHour = 0; yyMinutes = 0; @@ -1976,7 +1967,7 @@ get_date(p, now) return -1; } else { - Start = nowtime; + Start = now; if (!yyHaveRel) Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec; } @@ -2009,7 +2000,7 @@ main(ac, av) (void)printf("Enter date, or blank line to exit.\n\t> "); (void)fflush(stdout); while (gets(buff) && buff[0]) { - d = get_date(buff, (struct timeb *)NULL); + d = get_date(buff); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else diff --git a/gnu/usr.bin/cvs/lib/getdate.y b/gnu/usr.bin/cvs/lib/getdate.y index eb293763f39..789ae032c12 100644 --- a/gnu/usr.bin/cvs/lib/getdate.y +++ b/gnu/usr.bin/cvs/lib/getdate.y @@ -885,59 +885,50 @@ difftm (a, b) } time_t -get_date(p, now) - char *p; - struct timeb *now; +get_date(p) + char *p; { - struct tm *tm, gmt; - struct timeb ftz; + struct tm *tm, *gmt, gmtbuf; time_t Start; time_t tod; - time_t nowtime; + time_t now; + time_t timezone; yyInput = p; - if (now == NULL) { - struct tm *gmt_ptr; + (void)time (&now); - now = &ftz; - (void)time (&nowtime); - - gmt_ptr = gmtime (&nowtime); - if (gmt_ptr != NULL) - { - /* Make a copy, in case localtime modifies *tm (I think - that comment now applies to *gmt_ptr, but I am too - lazy to dig into how gmtime and locatime allocate the - structures they return pointers to). */ - gmt = *gmt_ptr; - } + gmt = gmtime (&now); + if (gmt != NULL) + { + /* Make a copy, in case localtime modifies *tm (I think + that comment now applies to *gmt, but I am too + lazy to dig into how gmtime and locatime allocate the + structures they return pointers to). */ + gmtbuf = *gmt; + gmt = &gmtbuf; + } - if (! (tm = localtime (&nowtime))) - return -1; + if (! (tm = localtime (&now))) + return -1; - if (gmt_ptr != NULL) - ftz.timezone = difftm (&gmt, tm) / 60; - else - /* We are on a system like VMS, where the system clock is - in local time and the system has no concept of timezones. - Hopefully we can fake this out (for the case in which the - user specifies no timezone) by just saying the timezone - is zero. */ - ftz.timezone = 0; - - if(tm->tm_isdst) - ftz.timezone += 60; - } + if (gmt != NULL) + timezone = difftm (gmt, tm) / 60; else - { - nowtime = now->time; - } + /* We are on a system like VMS, where the system clock is + in local time and the system has no concept of timezones. + Hopefully we can fake this out (for the case in which the + user specifies no timezone) by just saying the timezone + is zero. */ + timezone = 0; + + if(tm->tm_isdst) + timezone += 60; - tm = localtime(&nowtime); + tm = localtime(&now); yyYear = tm->tm_year + 1900; yyMonth = tm->tm_mon + 1; yyDay = tm->tm_mday; - yyTimezone = now->timezone; + yyTimezone = timezone; yyDSTmode = DSTmaybe; yyHour = 0; yyMinutes = 0; @@ -962,7 +953,7 @@ get_date(p, now) return -1; } else { - Start = nowtime; + Start = now; if (!yyHaveRel) Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec; } @@ -995,7 +986,7 @@ main(ac, av) (void)printf("Enter date, or blank line to exit.\n\t> "); (void)fflush(stdout); while (gets(buff) && buff[0]) { - d = get_date(buff, (struct timeb *)NULL); + d = get_date(buff); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else diff --git a/gnu/usr.bin/cvs/lib/xtime.h b/gnu/usr.bin/cvs/lib/xtime.h index 00d9fae874c..9cfcf589208 100644 --- a/gnu/usr.bin/cvs/lib/xtime.h +++ b/gnu/usr.bin/cvs/lib/xtime.h @@ -27,25 +27,6 @@ # endif /* !HAVE_SYS_TIME_H */ # endif /* !TIME_WITH_SYS_TIME */ -# ifdef HAVE_SYS_TIMEB_H -# include <sys/timeb.h> -# else /* HAVE_SYS_TIMEB_H */ -/* - * We use the obsolete `struct timeb' as part of our interface! - * Since the system doesn't have it, we define it here; - * our callers must do likewise. - * - * At the least we were using this in lib/getdate.y, but lib/system.h used to - * define it too, so maybe CVS is using it elsewhere. - */ -struct timeb { - time_t time; /* Seconds since the epoch */ - unsigned short millitm; /* Field not used */ - short timezone; /* Minutes west of GMT */ - short dstflag; /* Field not used */ -}; -# endif /* !HAVE_SYS_TIMEB_H */ - # ifdef timezone # undef timezone /* needed for sgi */ # endif /* timezone */ diff --git a/gnu/usr.bin/cvs/os2/config.h b/gnu/usr.bin/cvs/os2/config.h index 71c31a0da38..aa489c79a1f 100644 --- a/gnu/usr.bin/cvs/os2/config.h +++ b/gnu/usr.bin/cvs/os2/config.h @@ -257,9 +257,6 @@ /* Define if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the <sys/timeb.h> header file. */ -#define HAVE_SYS_TIMEB_H 1 - /* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H diff --git a/gnu/usr.bin/cvs/src/client.c b/gnu/usr.bin/cvs/src/client.c index 0c0df1bc91d..f7abc83391f 100644 --- a/gnu/usr.bin/cvs/src/client.c +++ b/gnu/usr.bin/cvs/src/client.c @@ -1578,7 +1578,7 @@ handle_mod_time (args, len) { if (stored_modtime_valid) error (0, 0, "protocol error: duplicate Mod-time"); - stored_modtime = get_date (args, NULL); + stored_modtime = get_date (args); if (stored_modtime == (time_t) -1) error (0, 0, "protocol error: cannot parse date %s", args); else diff --git a/gnu/usr.bin/cvs/src/cvs.h b/gnu/usr.bin/cvs/src/cvs.h index 30ed9da4068..8755f570db7 100644 --- a/gnu/usr.bin/cvs/src/cvs.h +++ b/gnu/usr.bin/cvs/src/cvs.h @@ -518,7 +518,7 @@ int update PROTO((int argc, char *argv[])); int xcmp PROTO((const char *file1, const char *file2)); int yesno PROTO((void)); void *valloc PROTO((size_t bytes)); -time_t get_date PROTO((char *date, struct timeb *now)); +time_t get_date PROTO((char *date)); extern int Create_Admin PROTO ((char *dir, char *update_dir, char *repository, char *tag, char *date, int nonbranch, int warn, int dotemplate)); diff --git a/gnu/usr.bin/cvs/src/history.c b/gnu/usr.bin/cvs/src/history.c index 945b1e116a9..106e987b2a2 100644 --- a/gnu/usr.bin/cvs/src/history.c +++ b/gnu/usr.bin/cvs/src/history.c @@ -508,7 +508,7 @@ history (argc, argv) char *buf = xmalloc (sizeof (f) - 2 + strlen (optarg)); time_t t; sprintf (buf, f, optarg); - t = get_date (buf, (struct timeb *) NULL); + t = get_date (buf); free (buf); if (t == (time_t) -1) error (0, 0, "%s is not a known time zone", optarg); diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c index 9c1f514afb0..aff26d56eb3 100644 --- a/gnu/usr.bin/cvs/src/main.c +++ b/gnu/usr.bin/cvs/src/main.c @@ -1078,7 +1078,7 @@ Make_Date (rawdate) { time_t unixtime; - unixtime = get_date (rawdate, (struct timeb *) NULL); + unixtime = get_date (rawdate); if (unixtime == (time_t) - 1) error (1, 0, "Can't parse date/time: %s", rawdate); return date_from_time_t (unixtime); diff --git a/gnu/usr.bin/cvs/src/rcs.c b/gnu/usr.bin/cvs/src/rcs.c index a21aba51234..5684a7e3dbf 100644 --- a/gnu/usr.bin/cvs/src/rcs.c +++ b/gnu/usr.bin/cvs/src/rcs.c @@ -3057,7 +3057,7 @@ RCS_getrevtime (rcs, rev, date, fudge) ftm->tm_min, ftm->tm_sec); /* turn it into seconds since the epoch */ - revdate = get_date (tdate, (struct timeb *) NULL); + revdate = get_date (tdate); if (revdate != (time_t) -1) { revdate -= fudge; /* remove "fudge" seconds */ diff --git a/gnu/usr.bin/cvs/src/server.c b/gnu/usr.bin/cvs/src/server.c index 8d7114256b8..91afd17918d 100644 --- a/gnu/usr.bin/cvs/src/server.c +++ b/gnu/usr.bin/cvs/src/server.c @@ -1919,7 +1919,7 @@ serve_checkin_time (arg) return; } - checkin_time = get_date (arg, NULL); + checkin_time = get_date (arg); if (checkin_time == (time_t)-1) { if (alloc_pending (80 + strlen (arg))) diff --git a/gnu/usr.bin/cvs/src/subr.c b/gnu/usr.bin/cvs/src/subr.c index 597b2f137f6..b9b8227ceda 100644 --- a/gnu/usr.bin/cvs/src/subr.c +++ b/gnu/usr.bin/cvs/src/subr.c @@ -382,9 +382,8 @@ getcaller () #ifndef __GNUC__ /* ARGSUSED */ time_t -get_date (date, now) +get_date (date) char *date; - struct timeb *now; { time_t foo = 0; diff --git a/gnu/usr.bin/cvs/vms/config.h b/gnu/usr.bin/cvs/vms/config.h index af8c2060792..67470018f45 100644 --- a/gnu/usr.bin/cvs/vms/config.h +++ b/gnu/usr.bin/cvs/vms/config.h @@ -159,10 +159,6 @@ /* Define this if your <sys/socket.h> defines select() */ #define SYS_SOCKET_H_DEFINES_SELECT 1 -/* Define if you have the <sys/timeb.h> header file. */ -#define HAVE_SYS_TIMEB_H 1 -#define HAVE_TIMEB_H 1 - /* Define if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 diff --git a/gnu/usr.bin/cvs/windows-NT/config.h b/gnu/usr.bin/cvs/windows-NT/config.h index 2750b644f3d..468ee024e2d 100644 --- a/gnu/usr.bin/cvs/windows-NT/config.h +++ b/gnu/usr.bin/cvs/windows-NT/config.h @@ -212,9 +212,6 @@ /* Define if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the <sys/timeb.h> header file. */ -#define HAVE_SYS_TIMEB_H 1 - /* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H |