]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fd-util: group close_fd_ptr() with fd funcs, not FILE/DIR stream ones
authorMike Yuan <me@yhndnzj.com>
Mon, 26 May 2025 17:24:10 +0000 (19:24 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 26 May 2025 18:21:22 +0000 (20:21 +0200)
src/basic/fd-util.h

index 6e2b709657b87be66a9f5f0836a36df5c06e9583..3bb8152a7cf480b1cf1903f2bf17052a74188770 100644 (file)
@@ -29,6 +29,11 @@ static inline int safe_close_above_stdio(int fd) {
         return safe_close(fd);
 }
 
+static inline void* close_fd_ptr(void *p) {
+        safe_close(PTR_TO_FD(p));
+        return NULL;
+}
+
 void close_many(const int fds[], size_t n_fds);
 void close_many_unset(int fds[], size_t n_fds);
 void close_many_and_free(int *fds, size_t n_fds);
@@ -36,10 +41,6 @@ void close_many_and_free(int *fds, size_t n_fds);
 int fclose_nointr(FILE *f);
 FILE* safe_fclose(FILE *f);
 DIR* safe_closedir(DIR *f);
-static inline void* close_fd_ptr(void *p) {
-        safe_close(PTR_TO_FD(p));
-        return NULL;
-}
 
 static inline void closep(int *fd) {
         safe_close(*fd);