Hello Timothy,

Timothy Sample <samp...@ngyro.com> writes:

> One thing that ‘renumber_file_descriptor’ does that we seem to be losing
> here is error checking.  To my eye, the old code will try and warn the
> user if they run out of file descriptors, but the new code will not.

I may have been too hasty on that front, you're right that we should
check for errors when dup'ing.  Note though that we should not run out
of fds, as we close all of them except for in/out/err right before using
it, but still, here are the interesting error codes:
* EINTR, although OpenBSD and Linux will never set that error from my
light research;
* EBUSY, not POSIX though, only Linux, so should we?
* EMFILE, if we run out of fds;
* EBADF if either of the fds are invalid.

As for error reporting, should we keep the parent's stderr fd open while
we do all of this, just to be able to report an error in case it
happens?  The old code used to try reporting the errors to the new `err`
fd instead, but it might be clearer to use stderr.

WDYT?

-- 
Josselin Poiret



  • bug#52835: [PAT... Bug reports for GUILE, GNU's Ubiquitous Extension Language
    • bug#52835:... Bug reports for GUILE, GNU's Ubiquitous Extension Language
    • bug#52835:... Bug reports for GUILE, GNU's Ubiquitous Extension Language
      • bug#52... Bug reports for GUILE, GNU's Ubiquitous Extension Language
    • bug#52835:... Timothy Sample
      • bug#52... Bug reports for GUILE, GNU's Ubiquitous Extension Language
        • bu... Bug reports for GUILE, GNU's Ubiquitous Extension Language
          • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
            • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
            • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
            • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
            • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
            • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
              • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
              • ... Bug reports for GUILE, GNU's Ubiquitous Extension Language
                • ... Ludovic Courtès

Reply via email to