From e4ac5643e11239bff646542b9df133ebab56619e Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Wed, 20 Sep 2017 11:27:05 +0300 Subject: [PATCH] lib: remove close_keep_errno() --- src/lib/lib.c | 12 ------------ src/lib/lib.h | 1 - 2 files changed, 13 deletions(-) diff --git a/src/lib/lib.c b/src/lib/lib.c index ba4e443315..413474fcc1 100644 --- a/src/lib/lib.c +++ b/src/lib/lib.c @@ -29,18 +29,6 @@ struct atexit_callback { 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) { diff --git a/src/lib/lib.h b/src/lib/lib.h index a02fbb1f7c..995fec4b67 100644 --- a/src/lib/lib.h +++ b/src/lib/lib.h @@ -55,7 +55,6 @@ typedef void lib_atexit_callback_t(void); 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. */