chiark / gitweb /
copy: adjust directory times after writing to the directory
[elogind.git] / src / basic / fd-util.c
index d1b1db3a4ddc83b8c73ecf7c3ff51a19885d2fef..9c15b91c312dd5c8a90127cd3a941182f5b0e3c7 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 /***
   This file is part of systemd.
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "dirent-util.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/resource.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
 #include "fd-util.h"
+#include "macro.h"
+#include "missing.h"
 #include "parse-util.h"
+#include "path-util.h"
 #include "socket-util.h"
 #include "util.h"
 
@@ -120,6 +127,7 @@ FILE* safe_fclose(FILE *f) {
         return NULL;
 }
 
+#if 0 /// UNNEEDED by elogind
 DIR* safe_closedir(DIR *d) {
 
         if (d) {
@@ -130,6 +138,7 @@ DIR* safe_closedir(DIR *d) {
 
         return NULL;
 }
+#endif // 0
 
 int fd_nonblock(int fd, bool nonblock) {
         int flags, nflags;
@@ -222,7 +231,7 @@ int close_all_fds(const int except[], unsigned n_except) {
         while ((de = readdir(d))) {
                 int fd = -1;
 
-                if (hidden_file(de->d_name))
+                if (hidden_or_backup_file(de->d_name))
                         continue;
 
                 if (safe_atoi(de->d_name, &fd) < 0)
@@ -248,6 +257,7 @@ int close_all_fds(const int except[], unsigned n_except) {
         return r;
 }
 
+#if 0 /// UNNEEDED by elogind
 int same_fd(int a, int b) {
         struct stat sta, stb;
         pid_t pid;
@@ -349,3 +359,4 @@ bool fdname_is_valid(const char *s) {
 
         return p - s < 256;
 }
+#endif // 0