[PATCH 3/5] Dynamic Pseudo Root

Steve Dickson SteveD at redhat.com
Wed Feb 27 09:18:33 EST 2008



Greg Banks wrote:
> Steve Dickson wrote:
>> Greg Banks wrote:
>>
>>   
>>   
>>>> +		if (WIFEXITED(status) /* && (kiderr = WEXITSTATUS(status))*/ ) {
>>>>   
>>>> +			cc = read(pfd[0], buf, BUFSIZ);
>>>> +			if (cc > 0) { 
>>>> +				if ((ch = strrchr(buf, '\n')) != NULL)
>>>> +					*ch = '\0';
>>>> +				errno = 0;
>>>> +				syserror(buf);
>>>>   
>>>>       
>>> I don't think this call to syserror() is doing what you think itto do so is a good thing...
's
>>> doing.  errno is in general not zeroed on successful system calls,
>>> so the xlog() call may contain a description of an errno left over
>>> from some unrelated failed system call dozens of calls ago.  Instead
>>> you should inline the xlog() call in the errno==0 branch of syserror().
>>>     
>> I do understand the fact that errno may have a old error code and inlining 
>> xlog probably would be a good idea but thats a change that would effect a 
>> number of other daemons... something that probably a bit out the scope 
>> of this patch... 
>>   
> Whoops, I see from your reply that I phrased my comment very badly.  What
> I meant was: you could at this point instead of calling xlog() and relying
> on a specific value of errno, call xlog() in the same way that the 2nd half
> of syserror() does.
Ok.. I see your point.. If this code becomes live, I'll look into fixing
that... thanks!

steved.
 


More information about the NFSv4 mailing list