bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: who(1) exit status


From: Shal-Linux-Ind
Subject: Re: who(1) exit status
Date: Tue, 24 Jun 2008 15:18:59 +0530

I am surprised that utmpname(3) man page says return value is void...

but in source i have verified that its returning integer.

I have verified in glibc 2.7.

Thanks,

Halesh

On 6/24/08, Shal-Linux-Ind <address@hidden> wrote:
>
>
>
> On 6/23/08, Andreas Schwab <address@hidden> wrote:
>>
>> Eric Blake <address@hidden> writes:
>>
>> > According to Shal-Linux-Ind on 6/23/2008 4:05 AM:
>> > | Hi,
>> > |
>> > | who(1) exit status is always 0.
>> > |
>> > | $ who --v
>> > | who (coreutils) 5.2.1
>> >
>> > Thanks for the report.  Consider upgrading - that is several years old,
>> > and the latest stable version is 6.12.  But I have confirmed that the
>> > issue still exists in git beyond 6.12:
>> >
>> > $ who /nosuch/file; echo $?
>> > 0
>>
>>
>> See the comment in read_utmp:
>>
>>   /* Ignore the return value for now.
>>      Solaris' utmpname returns 1 upon success -- which is contrary
>>      to what the GNU libc version does.  In addition, older GNU libc
>>      versions are actually void.   */
>>   UTMP_NAME_FUNCTION (file);
>>
>> When using the utmpname/setutent/getutmp family of functions there
>> really is no way to check for errors reading the file, since utmpname
>> does not actually try to open it, and setutent has no return value.
>>
>> **utmpname() returns integer, only when failure on allocating memory its
>> returning -1, its best to include the file existance checking before memory
>> allocation, and returning -1 if no such file exists.
>>
>> **Need to check the compitibilty breaking, I think there is no
>> compitibility breaking.
>>
>>  **Thanks,Halesh
>>
>> Andreas.
>>
>>
>> --
>> Andreas Schwab, SuSE Labs, address@hidden
>> SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
>> PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
>> "And now for something completely different."
>>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]