www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/26/15:23:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <BAY119-W47F05E57C32277ECE22EF4A9F70@phx.gbl>
From: <sbremal AT hotmail DOT com>
To: <cygwin AT cygwin DOT com>
Subject: fuser exit codes (bug?)
Date: Wed, 26 Aug 2009 19:23:32 +0000
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hello,

I wonder if the fuser utility coming with Cygwin is returning an error code that isn't in line with the IEEE specifaction. What is happening:

---

somogyib AT demuc12306 ~
$ fuser /cygdrive/f/Bazsi/cygwin/bin/bash; echo $?
/cygdrive/f/Bazsi/cygwin/bin/bash:  2708e
0
somogyib AT demuc12306 ~
$ fuser /cygdrive/f/Bazsi/cygwin/bin/awk; echo $?
1

---
 
So, the "bash" file is locked by one process and "awk" is by zero.

For both scenarios FreeBSD returns 0 which I assume to be correct. The IEEE standard says fuser should return non-zero value only when an error occured.
 
---

www.unix.org\single_unix_specification\susv3\utilities\fuser.html

EXIT STATUS
The following exit values shall be returned:
 0 
Successful completion. 
>0 
An error occurred.

---

A file being locked by one, two or ZERO process is all positive scenario so fuser should return 0. What's you opinion? Can this be fixed?

Cheers,
Balazs
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019