From ac0ee06b3ed2be9e8c0c874af9b3be731e1242ea Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 24 Jul 1997 11:29:18 +0000 Subject: [PATCH] (gettime): use `parse_time' git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2615 ec53bebd-3082-4978-b11e-865c3cabbd6b --- admin/gettime.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/admin/gettime.c b/admin/gettime.c index 1cfe203ae..49c0851ea 100644 --- a/admin/gettime.c +++ b/admin/gettime.c @@ -37,32 +37,13 @@ */ #include "admin_locl.h" -#if defined (HAVE_SYS_TIMEB_H) -#include -#else - -/* get_date uses the obsolete `struct timeb' in its interface! FIXME. - Since some systems don't have it, we define it here; - 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 time_t -gettime(const char *prompt, const char *def, int relative) +gettime(const char *prompt, const char *def) { char buf[1024]; time_t t; - struct timeb now, *tp = NULL; - if(relative){ - memset(&now, 0, sizeof(now)); - tp = &now; - } while(1){ printf("%s", prompt); if(def) @@ -74,7 +55,7 @@ gettime(const char *prompt, const char *def, int relative) if(def && buf[0] == 0) strcpy(buf, def); if(strcmp(buf, "infinite") == 0 || strcmp(buf, "unlimited") == 0) return 0; - t = get_date(buf, tp); + t = parse_time (buf, NULL); if(t != -1) return t; printf("Unrecognised time.\n");