sbin/hammer: Change fprintf/exit to err variants [1/2]
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 15 Dec 2016 15:17:19 +0000 (00:17 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 15 Dec 2016 17:53:48 +0000 (02:53 +0900)
commitbac217f3427aaf2d01616d8630b4d8e05a865bfd
treeb83582b0503cc242f82510f44d9738aa631ad949
parente671cfa600999a44074bfd4f62c3346b02178217
sbin/hammer: Change fprintf/exit to err variants [1/2]

Change
fprintf(stderr, ...); exit(1);
and
perror(...); exit(1);
to
err(1, ...) or errx(1, ...);
where possible for consistency.

In test_volume(), if open(2)/pread(2) failed, err(1) without
scanning rest of the volumes. This function itself is redundant
anyway as mentioned in 1e297b34, so no one cares.

Other than that this is just conversion to err(3) variants.
Messages themselves are not changed, except for removing
strerror(errno) for err(3), and removing trailing \n,
though err variants add program name in the messages.

err(3) and variants are non standard BSD functions, but HAMMER
userspace has been using BSD stuff aside from the existing
err/errx. Also note that err(3) is available in Linux as well.
sbin/mount_hammer/mount_hammer.c