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

Re: [Xen-devel] [PATCH] xl: close nullfd after dup2'ing it to stdin



Ian Campbell writes ("[PATCH] xl: close nullfd after dup2'ing it to stdin"):
> Taking care not to do so if nullfd happens (somehow) to have the same
> fd number as stdin/out/err.

I think that can only happen if the program (the process) has a
serious problem: ie, fd 0 1 or 2 would have to be closed.  If that
happens many other things can go badly wrong.

If this is causing Coverity to complain I would suggest adding
   assert(nullfd >= 3);
   assert(logfile >= 3);
instead.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.