loff_t *offset,
size_t *len)
{
- const char *off, *type, *mag, *p, *usage = NULL;
+ const char *off, *type, *mag, *p, *use = NULL;
struct wipe_desc *wp;
int rc, ispt = 0;
rc = blkid_probe_lookup_value(pr, "PTMAGIC", &mag, len);
if (rc)
return NULL;
- usage = N_("partition-table");
+ use = N_("partition-table");
ispt = 1;
} else
return NULL;
if (!wp)
return NULL;
- if (usage || blkid_probe_lookup_value(pr, "USAGE", &usage, NULL) == 0)
- wp->usage = xstrdup(usage);
+ if (use || blkid_probe_lookup_value(pr, "USAGE", &use, NULL) == 0)
+ wp->usage = xstrdup(use);
wp->type = xstrdup(type);
wp->on_disk = 1;
return NULL;
if (mode) {
- int fd = open(devname, mode);
+ int fd = open(devname, mode | O_NONBLOCK);
if (fd < 0)
goto error;
printf(USAGE_HELP_OPTIONS(21));
+ fputs(USAGE_ARGUMENTS, stdout);
+ printf(USAGE_ARG_SIZE(_("<num>")));
+
fputs(USAGE_COLUMNS, stdout);
for (i = 0; i < ARRAY_SIZE(infos); i++)
fprintf(stdout, " %8s %s\n", infos[i].name, _(infos[i].help));
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- atexit(close_stdout);
+ close_stdout_atexit();
while ((c = getopt_long(argc, argv, "abfhiJnO:o:pqt:V", longopts, NULL)) != -1) {
case 'f':
ctl.force = 1;
break;
- case 'h':
- usage();
- break;
case 'J':
ctl.json = 1;
break;
case 't':
ctl.type_pattern = optarg;
break;
+
+ case 'h':
+ usage();
case 'V':
- printf(UTIL_LINUX_VERSION);
- return EXIT_SUCCESS;
+ print_version(EXIT_SUCCESS);
default:
errtryhelp(EXIT_FAILURE);
}