diff options
author | J William Piggott | 2017-09-03 18:23:44 +0200 |
---|---|---|
committer | J William Piggott | 2017-09-03 18:23:44 +0200 |
commit | 652dcf51314abec641b01eb610d512ca8c813256 (patch) | |
tree | 4bd6c48a5343c4b3c6050f1d00cd4992d53815b9 /sys-utils/hwclock.c | |
parent | hwclock: remove sysexits.h (diff) | |
download | kernel-qcow2-util-linux-652dcf51314abec641b01eb610d512ca8c813256.tar.gz kernel-qcow2-util-linux-652dcf51314abec641b01eb610d512ca8c813256.tar.xz kernel-qcow2-util-linux-652dcf51314abec641b01eb610d512ca8c813256.zip |
hwclock: don't always use hwclock_exit
Special exit handling is not wanted for usage() or bad
command syntax. For example we do not want to audit:
hwclock --set --date foo
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'sys-utils/hwclock.c')
-rw-r--r-- | sys-utils/hwclock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index 82f919048..e471fe1ae 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -1061,7 +1061,7 @@ static void out_version(void) } static void __attribute__((__noreturn__)) -usage(const struct hwclock_control *ctl) +usage(void) { fputs(USAGE_HEADER, stdout); printf(_(" %s [function] [option...]\n"), program_invocation_short_name); @@ -1105,7 +1105,7 @@ usage(const struct hwclock_control *ctl) fputs(USAGE_SEPARATOR, stdout); printf(USAGE_HELP_OPTIONS(22)); printf(USAGE_MAN_TAIL("hwclock(8)")); - hwclock_exit(ctl, EXIT_SUCCESS); + exit(EXIT_SUCCESS); } int main(int argc, char **argv) @@ -1301,7 +1301,7 @@ int main(int argc, char **argv) out_version(); return 0; case 'h': /* --help */ - usage(&ctl); + usage(); default: errtryhelp(EXIT_FAILURE); } @@ -1317,25 +1317,25 @@ int main(int argc, char **argv) if (ctl.update && !ctl.set && !ctl.systohc) { warnx(_("--update-drift requires --set or --systohc")); - hwclock_exit(&ctl, EXIT_FAILURE); + exit(EXIT_FAILURE); } if (ctl.noadjfile && !ctl.utc && !ctl.local_opt) { warnx(_("With --noadjfile, you must specify " "either --utc or --localtime")); - hwclock_exit(&ctl, EXIT_FAILURE); + exit(EXIT_FAILURE); } if (ctl.set || ctl.predict) { if (!ctl.date_opt) { warnx(_("--date is required for --set or --predict")); - hwclock_exit(&ctl, EXIT_FAILURE); + exit(EXIT_FAILURE); } if (parse_date(&when, ctl.date_opt, NULL)) set_time = when.tv_sec; else { warnx(_("invalid date '%s'"), ctl.date_opt); - hwclock_exit(&ctl, EXIT_FAILURE); + exit(EXIT_FAILURE); } } |