return special ? do_swapoff(special, quiet, CANONIC) : cannot_find(value);
}
-static void __attribute__ ((__noreturn__)) usage(FILE * out)
+static void __attribute__((__noreturn__)) usage(void)
{
+ FILE *out = stdout;
fputs(USAGE_HEADER, out);
fprintf(out, _(" %s [options] [<spec>]\n"), program_invocation_short_name);
" <file> name of file to be used\n"), out);
fprintf(out, USAGE_MAN_TAIL("swapoff(8)"));
- exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
}
static int swapoff_all(void)
++all;
break;
case 'h': /* help */
- usage(stdout);
+ usage();
break;
case 'v': /* be chatty */
++verbose;
}
argv += optind;
- if (!all && !numof_labels() && !numof_uuids() && *argv == NULL)
- usage(stderr);
+ if (!all && !numof_labels() && !numof_uuids() && *argv == NULL) {
+ warnx(_("bad usage"));
+ errtryhelp(EXIT_FAILURE);
+ }
mnt_init_debug(0);
mntcache = mnt_new_cache();