Re: [PATCH 03/10] nfs-utils: convert rpc.nfsd to use xlog()

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

 



On Wed, 3 Jun 2009 16:22:14 -0400
Jeff Layton <jlayton@xxxxxxxxxx> wrote:

> On Wed, 3 Jun 2009 16:01:24 -0400
> Chuck Lever <chuck.lever@xxxxxxxxxx> wrote:
> 
> > > -	openlog("nfsd", LOG_PID, LOG_DAEMON);
> > > -	if ((error = nfssvc(port, count, versbits, minorvers4, protobits,  
> > > haddr)) < 0) {
> > > -		int e = errno;
> > > -		syslog(LOG_ERR, "nfssvc: %s", strerror(e));
> > > -		closelog();
> > > -	}
> > > +	if ((error = nfssvc(port, count, versbits, minorvers4, protobits,  
> > > haddr)) < 0)
> > > +		xlog(L_ERROR, "nfssvc (%m)");
> > 
> > Nit: Maybe get rid of the "nfssvc" here as well?
> > 
> 
> Well, the "nfssvc" here tells us that the nfssvc() call returned an
> error. Later patches will clean that up when I break up the nfssvc()
> interface. That said though, there's a bug there. %m isn't appropriate
> since errno isn't being set. Whoops!
> 

Ahh nm. In most cases, errno will be set on error. The exception is if
the code ended up using the legacy nfsctl() call. In that case, I don't
think it gets set. Hopefully that's rare enough not to matter much.


-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux