From: Mark Eichin Date: Fri, 24 Feb 1995 00:54:58 +0000 (+0000) Subject: * kdb5_edit.c: add struct timeb and sys/timeb includes from X-Git-Tag: krb5-1.0-beta5~671 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=be852e1534147034d1bd2753162edcda891e3360;p=krb5.git * kdb5_edit.c: add struct timeb and sys/timeb includes from getdate.y. (ftime): new function, in case we don't HAVE_FTIME. Ezra's changes, since solaris needs them. kadmin.new/client may need these too; accordging to glimpse, that's the only other use of ftime... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4997 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/admin/edit/ChangeLog b/src/admin/edit/ChangeLog index e6142bfb8..ec2ec45e6 100644 --- a/src/admin/edit/ChangeLog +++ b/src/admin/edit/ChangeLog @@ -1,3 +1,9 @@ +Thu Feb 23 19:52:35 1995 Mark Eichin (eichin@cygnus.com) + + * kdb5_edit.c: add struct timeb and sys/timeb includes from + getdate.y. + (ftime): new function, in case we don't HAVE_FTIME. + Tue Feb 14 17:55:47 1995 Tom Yu (tlyu@dragons-lair) * kdb5_edit.c: add modent diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index 77d987265..c734eef4c 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -36,7 +36,22 @@ #include #include #include +/* timeb is part of the interface to get_date. */ +#if defined(HAVE_SYS_TIMEB_H) #include +#else +/* +** 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. +*/ +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 /* defined(HAVE_SYS_TIMEB_H) */ #include "kdb5_edit.h" @@ -1792,3 +1807,19 @@ quit() } return 0; } + +#ifndef HAVE_FTIME +ftime(tp) + register struct timeb *tp; +{ + struct timeval t; + struct timezone tz; + + if (gettimeofday(&t, &tz) < 0) + return (-1); + tp->time = t.tv_sec; + tp->millitm = t.tv_usec / 1000; + tp->timezone = tz.tz_minuteswest; + tp->dstflag = tz.tz_dsttime; +} +#endif