Re: [PATCH] compat: convert modes to use portable file type values

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

 



David Michael <fedora.dm0@xxxxxxxxx> writes:

>> Huh?  I am confused.  Since when is it legal to give NULL as statbuf
>> to (l)stat(2)?
>>
>> Wouldn't something like this be sufficient and necessary?
>>
>>         int rc = stat(path, buf);
>>         if (rc)
>>                 return rc;
>>
>> That is, let the underlying stat(2) diagnose any and all problems
>> (and leave clues in errno) and parrot its return value to the caller
>> to signal the failure?
>
> Alright, it wasn't immediately clear to me from the OpenGroup page on
> stat() if that would always be safe.  I will just test the return code
> in v2.

It is irrelevant if that is safe or not.  As long as we are
emulating the underlying stat(), whether it is unsafe for stat(), we
should just throw whatever the user throws at us at the underlying
stat() and let it behave as if our emulation layer were not there.

Which is what the above snippet does.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]