summaryrefslogtreecommitdiff
path: root/lib/libc/time/zic.c
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-01-29 07:04:06 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-01-29 07:04:06 +0000
commit7147b6fb5082ac29448d3f5d61e0070da3defa7e (patch)
tree7e02d63646cbbe078d3e641ff4882d7e259116ae /lib/libc/time/zic.c
parent8f1b667df4d5dce7ae9d411f9a04144288941546 (diff)
tzcode1999a from ftp://elsie.nci.nih.gov/pub
Diffstat (limited to 'lib/libc/time/zic.c')
-rw-r--r--lib/libc/time/zic.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/libc/time/zic.c b/lib/libc/time/zic.c
index d3e9a3a1c6d..a75d32f4af7 100644
--- a/lib/libc/time/zic.c
+++ b/lib/libc/time/zic.c
@@ -1,6 +1,6 @@
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
-static char elsieid[] = "@(#)zic.c 7.93";
-static char rcsid[] = "$OpenBSD: zic.c,v 1.8 1999/01/28 23:44:37 espie Exp $";
+static char elsieid[] = "@(#)zic.c 7.96";
+static char rcsid[] = "$OpenBSD: zic.c,v 1.9 1999/01/29 07:04:05 d Exp $";
#endif /* LIBC_SCCS and not lint */
#include "private.h"
@@ -380,7 +380,7 @@ int errnum;
extern int sys_nerr;
return (errnum > 0 && errnum <= sys_nerr) ?
- sys_errlist[errnum] : "Unknown system error";
+ sys_errlist[errnum] : _("Unknown system error");
}
#endif /* !(HAVE_STRERROR - 0) */
@@ -429,7 +429,7 @@ const char * const string;
{
char * cp;
- cp = ecpyalloc("warning: ");
+ cp = ecpyalloc(_("warning: "));
cp = ecatalloc(cp, string);
error(cp);
ifree(cp);
@@ -600,9 +600,19 @@ const char * const tofile;
if (!itsdir(toname))
(void) remove(toname);
if (link(fromname, toname) != 0) {
+ int result;
+
if (mkdirs(toname) != 0)
(void) exit(EXIT_FAILURE);
- if (link(fromname, toname) != 0) {
+ result = link(fromname, toname);
+#if (HAVE_SYMLINK - 0)
+ if (result != 0) {
+ result = symlink(fromname, toname);
+ if (result == 0)
+warning(_("hard link failed, symbolic link used"));
+ }
+#endif
+ if (result != 0) {
const char *e = strerror(errno);
(void) fprintf(stderr,
@@ -890,9 +900,10 @@ const int signable;
error(errstring);
return 0;
}
- if (hh < 0 || hh >= HOURSPERDAY ||
+ if ((hh < 0 || hh >= HOURSPERDAY ||
mm < 0 || mm >= MINSPERHOUR ||
- ss < 0 || ss > SECSPERMIN) {
+ ss < 0 || ss > SECSPERMIN) &&
+ !(hh == HOURSPERDAY && mm == 0 && ss == 0)) {
error(errstring);
return 0;
}