git: sbin/hammer: Change fprintf/exit to err variants [1/2]
Tomohiro Kusumi
tkusumi at crater.dragonflybsd.org
Thu Dec 15 11:21:45 PST 2016
commit bac217f3427aaf2d01616d8630b4d8e05a865bfd
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date: Fri Dec 16 00:17:19 2016 +0900
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.
Summary of changes:
sbin/mount_hammer/mount_hammer.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bac217f3427aaf2d01616d8630b4d8e05a865bfd
--
DragonFly BSD source repository
More information about the Commits
mailing list