From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 11 19:53:30 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F22B16A49E; Mon, 11 Sep 2006 19:53:30 +0000 (UTC) (envelope-from ssedov@mbsd.msk.ru) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id B618B43D70; Mon, 11 Sep 2006 19:53:18 +0000 (GMT) (envelope-from ssedov@mbsd.msk.ru) Received: from [213.87.86.28] (helo=fonon.realnet) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1GMrq0-0002Yq-84; Mon, 11 Sep 2006 23:53:01 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id 514DB11B23; Mon, 11 Sep 2006 23:52:13 +0400 (MSD) Date: Mon, 11 Sep 2006 23:52:11 +0400 From: Stanislav Sedov To: Roy Marples Message-ID: <20060911235211.140f90f5@localhost> In-Reply-To: <200609111909.23599.uberlord@gentoo.org> References: <200609102148.26767.uberlord@gentoo.org> <20060911125816.4a606317@localhost> <200609111909.23599.uberlord@gentoo.org> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_4bE07RwAcCewy/.4MYv6CF2"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Cc: freebsd-hackers@freebsd.org, freebsd-standards@freebsd.org Subject: Re: FreeBSD Port: sysutils/fuser X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 19:53:30 -0000 --Sig_4bE07RwAcCewy/.4MYv6CF2 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Mon, 11 Sep 2006 19:09:23 +0100 Roy Marples mentioned: > On Monday 11 September 2006 09:58, Stanislav Sedov wrote: > > On Sun, 10 Sep 2006 21:48:26 +0100 > > > > Roy Marples mentioned: > > > Hi > > > > > > I'm currently adding FreeBSD support to Gentoo baselayout rc system. = We > > > use the linux fuser tool a bit, and rely on the return value being non > > > zero of no files are in use on the requested mount points. > > > > > > Attached is a patch that enables the same in FreeBSD > > > > But POSIX says the following: > > -------------------------------------------------------------- > > EXIT STATUS > > > > The following exit values shall be returned: > > > > 0 > > Successful completion. > > > > >0 > > > > An error occurred. > > -------------------------------------------------------------- > > > > So, as I understand correctly, we should return 0 in this case. >=20 > Do they define what <0 means? Could always return -1. >=20 > A return value is easier than checking output. >=20 But they wants the value 0 to be returned in case of no errors, and since there are no errors in case of no files opened on mountpoint, returning non-zero could break some apps that relies on POSIX functionality. IIRC, solaris resembles the same behavior. You can check fuser entry in POSIX, it's available for free on opengroup.org. I might miss something.=20 --=20 Stanislav Sedov MBSD labs, Inc. =F2=CF=D3=D3=C9=D1, =ED=CF=D3=CB=D7=C1 http://mbsd.msk.ru -------------------------------------------------------------------- If the facts don't fit the theory, change the facts. -- A. Einstein -------------------------------------------------------------------- PGP fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 --Sig_4bE07RwAcCewy/.4MYv6CF2 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFFBb5sK/VZk+smlYERAo0fAJ0Xy7k4av5aJLszGKnXCAn54cWXLwCfa2vM m8Yy9AR5xLVYWtQfczTwFEM= =7n33 -----END PGP SIGNATURE----- --Sig_4bE07RwAcCewy/.4MYv6CF2--