On Mon, 11 Sep 2006 19:09:23 +0100 Roy Marples <[EMAIL PROTECTED]> mentioned:
> On Monday 11 September 2006 09:58, Stanislav Sedov wrote: > > On Sun, 10 Sep 2006 21:48:26 +0100 > > > > Roy Marples <[EMAIL PROTECTED]> 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. > > Do they define what <0 means? Could always return -1. > > A return value is easier than checking output. > 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. -- Stanislav Sedov MBSD labs, Inc. <[EMAIL PROTECTED]> Россия, Москва 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
signature.asc
Description: PGP signature

