Todd C. Miller Wed, 29 Jul 2015 14:24:42 -0700
Note that fileno() does not set errno so you should probably set errno to EBADF before the calls to warn() or err().
- todd