static ARRAY(struct atexit_callback) atexit_callbacks = ARRAY_INIT;
-int close_keep_errno(int *fd)
-{
- int ret, old_errno = errno;
-
- i_assert(*fd != -1);
-
- ret = close(*fd);
- *fd = -1;
- errno = old_errno;
- return ret;
-}
-
void i_close_fd_real(int *fd, const char *arg, const char *func,
const char *file, int line)
{
also inside chroots. */
extern int dev_null_fd;
-int close_keep_errno(int *fd);
/* Close fd_in and fd_out, unless they're already -1. They can point to the
same fd, in which case they're closed only once. If they point to stdin
or stdout, they're replaced with /dev/null. */