From eb74a6e90b6cd5d7d9506cbf25a276efbf3ec6e5 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 16 Dec 1998 05:34:49 +0000 Subject: Old stuff lying around a source tree: Create/remove /etc/wall_cmos_clock without using system() and magic paths. --- usr.sbin/tzsetup/tzsetup.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'usr.sbin/tzsetup/tzsetup.c') 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 @@ -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, -- cgit v1.1