diff options
| author | Mark Eichin <eichin@mit.edu> | 1995-02-24 00:54:58 +0000 |
|---|---|---|
| committer | Mark Eichin <eichin@mit.edu> | 1995-02-24 00:54:58 +0000 |
| commit | be852e1534147034d1bd2753162edcda891e3360 (patch) | |
| tree | 053de1643a132c7858dfdee5c687011996a3dcbc /src/admin | |
| parent | a86a35ca434fb10da6c5eabd2cd2c6c48aebb181 (diff) | |
| download | krb5-be852e1534147034d1bd2753162edcda891e3360.tar.gz krb5-be852e1534147034d1bd2753162edcda891e3360.tar.xz krb5-be852e1534147034d1bd2753162edcda891e3360.zip | |
* 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
Diffstat (limited to 'src/admin')
| -rw-r--r-- | src/admin/edit/ChangeLog | 6 | ||||
| -rw-r--r-- | src/admin/edit/kdb5_edit.c | 31 |
2 files changed, 37 insertions, 0 deletions
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 <com_err.h> #include <stdio.h> #include <time.h> +/* timeb is part of the interface to get_date. */ +#if defined(HAVE_SYS_TIMEB_H) #include <sys/timeb.h> +#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 |
