env-util.c \
execv-const.c \
failures.c \
- fd-set-nonblock.c \
fd-util.c \
fdatasync-path.c \
fdpass.c \
env-util.h \
execv-const.h \
failures.h \
- fd-set-nonblock.h \
fd-util.h \
fdatasync-path.h \
fdpass.h \
+++ /dev/null
-/* Copyright (c) 1999-2017 Dovecot authors, see the included COPYING file */
-
-#include "lib.h"
-
-#include <fcntl.h>
-
-void fd_set_nonblock(int fd, bool nonblock)
-{
- int flags;
-
- flags = fcntl(fd, F_GETFL, 0);
- if (flags < 0)
- i_fatal("fcntl(%d, F_GETFL) failed: %m", fd);
-
- if (nonblock)
- flags |= O_NONBLOCK;
- else
- flags &= ~O_NONBLOCK;
-
- if (fcntl(fd, F_SETFL, flags) < 0)
- i_fatal("fcntl(%d, F_SETFL) failed: %m", fd);
-}
+++ /dev/null
-#ifndef FD_SET_NONBLOCK_H
-#define FD_SET_NONBLOCK_H
-
-/* Set file descriptor to blocking/nonblocking state */
-void fd_set_nonblock(int fd, bool nonblock);
-
-#endif
-/* Copyright (c) 2002-2017 Dovecot authors, see the included COPYING file */
+/* Copyright (c) 1999-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "net.h"
if (leaks)
i_fatal("fd leak found");
}
+
+void fd_set_nonblock(int fd, bool nonblock)
+{
+ int flags;
+
+ flags = fcntl(fd, F_GETFL, 0);
+ if (flags < 0)
+ i_fatal("fcntl(%d, F_GETFL) failed: %m", fd);
+
+ if (nonblock)
+ flags |= O_NONBLOCK;
+ else
+ flags &= ~O_NONBLOCK;
+
+ if (fcntl(fd, F_SETFL, flags) < 0)
+ i_fatal("fcntl(%d, F_SETFL) failed: %m", fd);
+}
#ifndef FD_UTIL_H
#define FD_UTIL_H
-#include "fd-set-nonblock.h"
-
/* Change close-on-exec flag of fd. */
void fd_close_on_exec(int fd, bool set);
/* Verify that fds in given range don't exist. */
void fd_debug_verify_leaks(int first_fd, int last_fd);
+/* Set file descriptor to blocking/nonblocking state */
+void fd_set_nonblock(int fd, bool nonblock);
+
#endif