diff options
Diffstat (limited to 'usr.sbin/tzsetup')
-rw-r--r-- | usr.sbin/tzsetup/paths.h | 1 | ||||
-rw-r--r-- | usr.sbin/tzsetup/tzsetup.c | 15 |
2 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/tzsetup/paths.h b/usr.sbin/tzsetup/paths.h index 10a6812..4754e9a 100644 --- a/usr.sbin/tzsetup/paths.h +++ b/usr.sbin/tzsetup/paths.h @@ -2,3 +2,4 @@ #define _PATH_ISO3166 "/usr/share/misc/iso3166" #define _PATH_ZONEINFO "/usr/share/zoneinfo" #define _PATH_LOCALTIME "/etc/localtime" +#define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock" diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 8f3f34c..42522b6 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tzsetup.c,v 1.9 1997/11/07 00:07:27 joerg Exp $"; + "$Id: tzsetup.c,v 1.10 1998/01/10 15:55:11 steve Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -631,7 +631,7 @@ usage() int main(int argc, char **argv) { - int c; + int c, fd; while ((c = getopt(argc, argv, "n")) != -1) { switch(c) { @@ -657,10 +657,15 @@ main(int argc, char **argv) "Is this machine's CMOS clock set to UTC? If it is set to local time,\n" "please choose NO here!", 7, 72)) { if (reallydoit) - system("rm -f /etc/wall_cmos_clock"); + unlink(_PATH_WALL_CMOS_CLOCK); } else { - if (reallydoit) - system("touch /etc/wall_cmos_clock"); + if (reallydoit) { + fd = open(_PATH_WALL_CMOS_CLOCK, + O_WRONLY|O_CREAT|O_TRUNC, 0666); + if (fd < 0) + err(1, "create %s", _PATH_WALL_CMOS_CLOCK); + close(fd); + } } dialog_clear_norefresh(); dialog_menu("Time Zone Selector", "Select a region", -1, -1, |