[sane-devel] [PATCH] Do not accidentally close STDIN/STDOUT/STDERR

Julien BLACHE jb at jblache.org
Mon Aug 4 08:50:25 UTC 2008

Nick Andrew <nick at nick-andrew.net> wrote:


> It's just basic defensive programming. The intent of saned is
> obviously to sanitise file descriptors 0, 1 and 2 by opening them
> all to /dev/null; if any of those file descriptors weren't open at
> program start then the sanitising will fail because one of the file
> descriptors will end up closed by accident. My patch merely ensures
> that the code delivers what was intended by the author.

There's no reason why the 3 standard descriptors would not be open
when saned starts up in standalone mode.


Julien BLACHE                                   <http://www.jblache.org> 
<jb at jblache.org>                                  GPG KeyID 0xF5D65169

More information about the sane-devel mailing list