summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McCullough <davidm@snapgear.com>2003-02-17 12:59:06 +0000
committerDavid McCullough <davidm@snapgear.com>2003-02-17 12:59:06 +0000
commit5433dd6660505ef694a1d8699c507da5a7c722e4 (patch)
tree91a08c2322382b5d4b81189fff565df2145d2d2f
parent6149f74892945c45c6907af3781dde55b9db0f87 (diff)
Use a define for the path to /etc/TZ
-rw-r--r--include/paths.h1
-rw-r--r--libc/misc/time/time.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/paths.h b/include/paths.h
index 90edcf8fd..38102d55a 100644
--- a/include/paths.h
+++ b/include/paths.h
@@ -67,6 +67,7 @@
#define _PATH_SHADOW "/etc/shadow"
#define _PATH_PASSWD "/etc/passwd"
#define _PATH_GROUP "/etc/group"
+#define _PATH_TZ "/etc/TZ"
/* Provide trailing slash, since mostly used for building pathnames. */
#define _PATH_DEV "/dev/"
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index ce33bc841..ad5abe6a2 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -136,6 +136,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include "paths.h"
/* ":<tzname>+hh:mm:ss<tzname>+hh:mm:ss,Mmm.w.d/hh:mm:ss,Mmm.w.d/hh:mm:ss" + nul */
/* 1 + 2*(1+TZNAME_MAX+1 + 9 + 7 + 9) + 1 = 2*TZNAME_MAX + 56 */
#else /* __TIME_TZ_FILE */
@@ -1537,7 +1538,7 @@ static char *read_TZ_file(char *buf)
size_t todo;
char *p = NULL;
- if ((fd = open("/etc/TZ", O_RDONLY)) >= 0) {
+ if ((fd = open(_PATH_TZ, O_RDONLY)) >= 0) {
todo = TZ_BUFLEN;
p = buf;
do {