From: Josef 'Jeff' Sipek Date: Wed, 4 Oct 2017 13:01:43 +0000 (-0400) Subject: lib: don't use foo_real()-style symbols in a header file X-Git-Tag: 2.3.0.rc1~880 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5f373495009b0dafb3670d759137070dd9b807f;p=thirdparty%2Fdovecot%2Fcore.git lib: don't use foo_real()-style symbols in a header file While there is precedent for symbols getting _real suffix to hide implementation details, all the existing symbols were static until the recent i_fd_close*() changes. This commit makes this true again. --- diff --git a/src/lib/fd-util.c b/src/lib/fd-util.c index e1febae312..88835b7f7a 100644 --- a/src/lib/fd-util.c +++ b/src/lib/fd-util.c @@ -131,8 +131,9 @@ void fd_close_maybe_stdio(int *fd_in, int *fd_out) } } -void i_close_fd_path_real(int *fd, const char *path, const char *arg, - const char *func, const char *file, int line) +#undef i_close_fd_path +void i_close_fd_path(int *fd, const char *path, const char *arg, + const char *func, const char *file, int line) { int saved_errno; diff --git a/src/lib/fd-util.h b/src/lib/fd-util.h index 698536cd98..54bdd63160 100644 --- a/src/lib/fd-util.h +++ b/src/lib/fd-util.h @@ -18,9 +18,9 @@ void fd_close_maybe_stdio(int *fd_in, int *fd_out); /* Close the fd and set it to -1. This assert-crashes if fd == 0, and is a no-op if fd == -1. Normally fd == 0 would happen only if an uninitialized fd is attempted to be closed, which is a bug. */ -void i_close_fd_path_real(int *fd, const char *path, const char *arg, - const char *func, const char *file, int line); -#define i_close_fd(fd) i_close_fd_path_real((fd), NULL, #fd, __func__, __FILE__, __LINE__) -#define i_close_fd_path(fd, path) i_close_fd_path_real((fd), (path), #fd, __func__, __FILE__, __LINE__) +void i_close_fd_path(int *fd, const char *path, const char *arg, + const char *func, const char *file, int line); +#define i_close_fd_path(fd, path) i_close_fd_path((fd), (path), #fd, __func__, __FILE__, __LINE__) +#define i_close_fd(fd) i_close_fd_path((fd), NULL) #endif