]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: don't use foo_real()-style symbols in a header file
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 4 Oct 2017 13:01:43 +0000 (09:01 -0400)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Thu, 5 Oct 2017 19:41:11 +0000 (15:41 -0400)
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.

src/lib/fd-util.c
src/lib/fd-util.h

index e1febae312cb01b10b3c7cb5204e07bc6296705c..88835b7f7a4ab1ef69b3f38c6afbbe38e86e9242 100644 (file)
@@ -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;
 
index 698536cd980849e7bff6ad6310e2ffe231719f41..54bdd631608f894d36d8b1a43063d1db760fc8d0 100644 (file)
@@ -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