summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tzsetup/tzsetup.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-10-27 07:49:47 +0000
committercharnier <charnier@FreeBSD.org>1997-10-27 07:49:47 +0000
commit8098c0d2f30fd6d4a73388d0802857a62f565edd (patch)
tree6aaf76b5ef258503d2f0b28036797d0ec4d7e931 /usr.sbin/tzsetup/tzsetup.c
parent8d124fec07a9cc63b694dc8a24bb3295138e93eb (diff)
downloadFreeBSD-src-8098c0d2f30fd6d4a73388d0802857a62f565edd.zip
FreeBSD-src-8098c0d2f30fd6d4a73388d0802857a62f565edd.tar.gz
Add usage(). Document -n flag. Do not touch/remove /etc/wall_cmos_clock
when -n (do nothing) is used.
Diffstat (limited to 'usr.sbin/tzsetup/tzsetup.c')
-rw-r--r--usr.sbin/tzsetup/tzsetup.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 7a77cdb..da8d9ee 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -25,8 +25,6 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
/*
@@ -34,6 +32,11 @@
* files provided in newer tzdata releases.
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include <sys/types.h>
#include <dialog.h>
#include <err.h>
@@ -618,6 +621,13 @@ set_zone_whole_country(dialogMenuItem *dmi)
return rv;
}
+static void
+usage()
+{
+ fprintf(stderr, "usage: tzsetup [-n]\n");
+ exit(1);
+}
+
int
main(int argc, char **argv)
{
@@ -630,16 +640,12 @@ main(int argc, char **argv)
break;
default:
- fprintf(stderr, "%s: usage:\n\t%s [-n]\n", argv[0],
- argv[0]);
- exit(1);
+ usage();
}
}
- if (optind != argc) {
- fprintf(stderr, "%s: usage:\n\t%s [-n]\n", argv[0], argv[0]);
- exit(1);
- }
+ if (optind != argc)
+ usage();
read_iso3166_table();
read_zones();
@@ -650,9 +656,11 @@ main(int argc, char **argv)
if (!dialog_yesno("Select local or UTC (Greenwich Mean Time) clock",
"Is this machine's CMOS clock set to UTC? If it is set to local time,\n"
"please choose NO here!", 7, 72))
- system("rm -f /etc/wall_cmos_clock");
+ if (reallydoit)
+ system("rm -f /etc/wall_cmos_clock");
else
- system("touch /etc/wall_cmos_clock");
+ if (reallydoit)
+ system("touch /etc/wall_cmos_clock");
dialog_clear_norefresh();
dialog_menu("Time Zone Selector", "Select a region", -1, -1,
NCONTINENTS, -NCONTINENTS, continents, 0, NULL, NULL);
OpenPOWER on IntegriCloud