git: sbin/hammer: Fix/remove redundant error variable

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


commit e671cfa600999a44074bfd4f62c3346b02178217
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Dec 15 18:16:36 2016 +0900

    sbin/hammer: Fix/remove redundant error variable
    
    Check ioctl result right after ioctl.
    Since this for-loop expects ioctl(GET_PSEUDOFS) to eventually
    return ENOENT for a new slot, error variable is likely to be
    overwritten with ENOENT by the time for-loop ends. This could
    result in overlooking possible real errors.
    
    If errno is checked (if not ENOENT) right after ioctl, there's
    also no need to preserve errno value.

Summary of changes:
 sbin/hammer/cmd_pfs.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e671cfa600999a44074bfd4f62c3346b02178217


-- 
DragonFly BSD source repository


More information about the Commits mailing list