Bug 588322

Summary: fuser'ing a non-existent file yields two error messages
Product: [Fedora] Fedora Reporter: Tim Landscheidt <tim>
Component: psmiscAssignee: Daniel Novotny <dnovotny>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 11CC: dnovotny
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-18 12:21:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
proposed patch none

Description Tim Landscheidt 2010-05-03 13:34:40 UTC
Description of problem:

When "fuser $NOTEXIST", fuser prints out two identical messages saying that it couldn't stat the file. This is at least confusing and should either be condensed to one message or the messages should be expanded (see below).


Version-Release number of selected component (if applicable):

psmisc-22.6-9.fc11.i586


How reproducible:

Always.


Steps to Reproduce:

1. "fuser doesnotex.ist"

  
Actual results:

| [tim@passepartout ~]$ fuser doesnotex.ist
| Cannot stat doesnotex.ist: Datei oder Verzeichnis nicht gefunden
| Cannot stat doesnotex.ist: Datei oder Verzeichnis nicht gefunden
| [tim@passepartout ~]$


Expected results:

Either one message or a more detailed explanation (see below).


Additional info:

The first line stems from fuser.c:333 (parse_*file* ()), the second from fuser.c:352 (parse_*unixsockets* ()). I'd assume that they should be exclusive to each other in some way.

Comment 1 Daniel Novotny 2010-05-05 11:46:52 UTC
Created attachment 411555 [details]
proposed patch

a patch: when the first stat fails, we will not do the other one

Comment 2 Tim Landscheidt 2010-05-05 21:29:50 UTC
The patch works for me, thanks; still, the "relationship" between parse_file () and parse_unixsockets () seems very clumsy though.

Comment 3 Daniel Novotny 2010-05-18 12:21:56 UTC
fixed in rawhide: psmisc-22.6-14.fc14