sbin/hammer: Fix error message on pfs open/ioctl failure
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 30 Mar 2015 13:28:17 +0000 (22:28 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Wed, 1 Apr 2015 21:09:32 +0000 (06:09 +0900)
commit3865ad2ff31118df608fdc43033b32b7341ccc28
tree0d9149a0fb36439f5355654f5d81207663b2a778
parentc8b9d242a2fe757c6e06f32abd37f0e20287d2bd
sbin/hammer: Fix error message on pfs open/ioctl failure

- "Not a HAMMER root" doesn't seem to be a good error message
  when getpfs() or ioctl(HAMMERIOC_GET_PSEUDOFS) has failed.

- getpfs() returning negative indicates open(2) has failed.
  ioctl(HAMMERIOC_GET_PSEUDOFS) returning negative (particularly
  when caller has set pfs->pfs_id to -1 before ioctl) usually
  indicates the fd has nothing to do with the existing valid pfs.
  It makes better sense with a message like "Invalid PFS path %s"
  or something.
sbin/hammer/cmd_pseudofs.c