git: sbin/hammer: Change fprintf/exit to err variants [2/2]

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Thu Dec 15 11:21:46 PST 2016


commit 02318f07beee82780ba5c99613d9e26974d14eb4
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Dec 15 16:56:17 2016 +0900

    sbin/hammer: Change fprintf/exit to err variants [2/2]
    
    Change
    fprintf(stderr, ...); exit(1);
    and
    perror(...); exit(1);
    to
    err(1, ...) or errx(1, ...);
    where possible for consistency.
    
    This commit 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/hammer/blockmap.c           |   6 +-
 sbin/hammer/cmd_dedup.c          |  19 +---
 sbin/hammer/cmd_history.c        |   9 +-
 sbin/hammer/cmd_info.c           |  18 +--
 sbin/hammer/cmd_mirror.c         | 240 +++++++++++++--------------------------
 sbin/hammer/cmd_pfs.c            | 121 +++++++-------------
 sbin/hammer/cmd_recover.c        |  12 +-
 sbin/hammer/cmd_remote.c         |  23 ++--
 sbin/hammer/cmd_softprune.c      |   8 +-
 sbin/hammer/cmd_strip.c          |   6 +-
 sbin/hammer/cmd_version.c        |  65 ++++-------
 sbin/hammer/cmd_volume.c         |  72 ++++--------
 sbin/hammer/hammer.c             |   8 +-
 sbin/newfs_hammer/newfs_hammer.c |  16 +--
 usr.bin/undo/undo.c              |  16 +--
 15 files changed, 212 insertions(+), 427 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/02318f07beee82780ba5c99613d9e26974d14eb4


-- 
DragonFly BSD source repository



More information about the Commits mailing list