addpart: improve error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-03-30 16:56:28 +02:00
parent 7e08b7d3ce
commit 0392dcf920
1 changed files with 6 additions and 8 deletions

View File

@ -47,17 +47,15 @@ int main(int argc, char **argv)
if (argc != 5)
usage(stderr);
if ((fd = open(argv[1], O_RDONLY)) < 0)
err(EXIT_FAILURE, "%s", argv[1]);
err(EXIT_FAILURE, _("%s: open failed"), argv[1]);
if (partx_add_partition(fd,
strtol_or_err(argv[2],
_("failed to parse argument")),
strtoll_or_err(argv[3],
_("failed to parse argument")),
strtoll_or_err(argv[4],
_("failed to parse argument"))))
err(EXIT_FAILURE, "BLKPG");
strtol_or_err(argv[2], _("failed to parse partition number")),
strtoll_or_err(argv[3],_("failed to parse start")),
strtoll_or_err(argv[4],_("failed to parse length"))))
err(EXIT_FAILURE, _("failed to add partition"));
return EXIT_SUCCESS;
}