- /* Check if the configured filename exists. If so, we need to open
- * it to prevent rename(2) from unlinking it. */
- if (stat(server.appendfilename, &st) == ENOENT) {
- oldfd = -1;
- } else {
- /* Don't care if this fails: oldfd will be -1. */
- oldfd = open(server.appendfilename,O_RDONLY|O_NONBLOCK);
- }
+ /* Don't care if this fails: oldfd will be -1 and we handle that.
+ * One notable case of -1 return is if the old file does
+ * not exist. */
+ oldfd = open(server.appendfilename,O_RDONLY|O_NONBLOCK);