Menu

#65 fuser return code inconsistent

Next Release
closed
None
1
2015-01-25
2015-01-23
Anonymous
No

Without any options, fuser works fine:

~/psmisc-22.21/src # ./fuser /tmp/wpa_ctrl_32578-1 ; echo $?
/tmp/wpa_ctrl_32578-1: 32579
0

With other options that shouldn't effect the return code, it returns 1:

~/psmisc-22.21/src # ./fuser -s /tmp/wpa_ctrl_32578-1 ; echo $?
Specified filename /tmp/wpa_ctrl_32578-1 is not a mountpoint.
1
~/psmisc-22.21/src # ./fuser -a /tmp/wpa_ctrl_32578-1 ; echo $?
Specified filename /tmp/wpa_ctrl_32578-1 is not a mountpoint.
1
~/psmisc-22.21/src # ./fuser -v /tmp/wpa_ctrl_32578-1 ; echo $?
Specified filename /tmp/wpa_ctrl_32578-1 is not a mountpoint.
1

Also note in the last two cases, the normal output is missing.

It seems to be this diff between 22.20 and 22.21:
--- psmisc-22.20/src/fuser.c 2012-09-19 06:54:03.000000000 -0400
+++ psmisc-22.21/src/fuser.c 2015-01-23 08:58:49.750437060 -0500
@@ -1155,6 +1173,11 @@ int main(int argc, char *argv[])
if (names_head == NULL)
usage(_("No process specification given"));

  • / Check if -M flag was used and if so check mounts /
  • if (opts * OPT_ISMOUNTPOINT) {
  • check_mountpoints(&mounts, &names_head, &names_tail);
  • }
    +
    if (opts & OPT_SILENT) {
    opts &= ~OPT_VERBOSE;
    opts &= ~OPT_USER;

That * should be &.

Discussion

  • Craig Small

    Craig Small - 2015-01-25

    Hi,
    Thanks for your report. This bug was fixed in commit [3638cc] back in Feb 2014.

     

    Related

    Commit: [3638cc]

  • Craig Small

    Craig Small - 2015-01-25
    • status: open --> closed
    • assigned_to: Craig Small
     

Anonymous
Anonymous

Add attachments
Cancel