dlog: Avoid trying to close an invalid file descriptor Avoid a call to close() for the output file descriptor if the file has not yet been opened. This can happen if no input at all is provided or --skip-empty/-e is enabled and only empty lines are read. The issue was reproducible as follows: % ./dlog -e < /dev/null WARN Closing log: Bad file descriptor [dlog.c:163, main] %