Menu

#66 fuser return status determined by last name only

Next Release
pending
None
1
2015-03-14
2015-02-03
Anonymous
No

The fuser command only looks at the last name listed on the command line to determine its matching (or killing) return status. This is counterintuitive (to me), because e.g. grep returns success if a match is found in any listed file. (Or killall which returns error if any kill failed, but its name says all, so that seems logical.)

I'm attaching a patch that makes fuser return with success if any match was found, or any process was killed. It may seem strange that the exit status can still be success if it failed to kill some process, but that's no different than before, and I expect this to be the most useful behaviour.

1 Attachments

Discussion

  • Craig Small

    Craig Small - 2015-03-14

    This can be seen where:
    sleep 100 &
    fuser -k /bin/sleep /bin/false
    returns 1

    but
    fuser -k /bin/false /bin/sleep
    returns 0

    The correct response is to always return 0 (which is what the fuser does without the k option).

    I think there is a simpler solution to this problem.

     
  • Craig Small

    Craig Small - 2015-03-14
    • status: open --> pending
    • assigned_to: Craig Small
     
  • Craig Small

    Craig Small - 2015-03-14

    This bug was fixed in [7c5cb8] a different way, but it gives the correct return value.

     

    Related

    Commit: [7c5cb8]


    Last edit: Craig Small 2015-03-14

Anonymous
Anonymous

Add attachments
Cancel