Completion of error handling
elfring opened this issue · 4 comments
Ok, let's see what could happen here...
dup2
: EBADF for oldfd can't happen, EBADF for newfd could happen (with very low limits), same for EMFILE, EBUSY could happen on Linux I guess, EINTR could happen... probably we can just panic when anything bad happens here.
flock
: I guess we should catch EINTR, and panic on ENOLCK... rest should not happen.
I suggest to avoid ignorance of return values a bit more.
Are you interested to apply aspect-oriented software development?
How do you think about to encapsulate error detection and corresponding exception handling as a reusable aspect in your software?
Ok, EINTR cannot happen either because we don't use signals.
I checked the dup2 calls now, I don't think islocked needs change.
I think your suggestions are overkill for a tiny 500 loc C progam. ;)
How do you think about to improve static source code analysis also for your software?