From dd917df96fbfc739269867eb601358a0473ec067 Mon Sep 17 00:00:00 2001 From: dfs Date: Sun, 7 Sep 1997 19:19:11 +0000 Subject: [PATCH] -- Removed use of difftime() -- SunOS doesn't have it. --- main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index eef892ed..43d8ec9d 100644 --- a/main.c +++ b/main.c @@ -11,7 +11,7 @@ /***************************************************************/ #include "config.h" -static char const RCSID[] = "$Id: main.c,v 1.8 1997-07-13 16:18:49 dfs Exp $"; +static char const RCSID[] = "$Id: main.c,v 1.9 1997-09-07 19:19:11 dfs Exp $"; #ifdef HAVE_STDLIB_H #include @@ -1264,20 +1264,14 @@ int jul, tim, *mins, *isdst; temp = localtime(&loc_t); /* Compute difference between local time and UTC in seconds. Be careful, since time_t might be unsigned. */ -#ifdef HAVE_MKTIME - /* If we have mktime(), then we have difftime(), so use it! */ - tdiff = (int) difftime(loc_t, utc_t); - if (mins) *mins = (int)(((temp->tm_isdst) ? 60 : 0) + tdiff / 60 ); -#else - /* If we don't have mktime(), we probably don't have difftime(), - so use this rather non-portable code. */ + + /* I would love to use difftime(), but SunOS doesn't have it. */ if (loc_t < utc_t) { tdiff = - (int) (utc_t - loc_t); } else { tdiff = (int) (loc_t - utc_t); } if (mins) *mins = (int)(tdiff / 60); -#endif if (isdst) *isdst = temp->tm_isdst; return 0; }