chiark / gitweb /
shutdown: drop redundant sync() invocation
[elogind.git] / src / util.c
index d769d60986f136d628d0eb0cfac21c3f9c478a35..0d1116dc12676cc341b8ff4df9c54c047f14a3b4 100644 (file)
@@ -3386,6 +3386,8 @@ int wait_for_terminate_and_warn(const char *name, pid_t pid) {
 }
 
 void freeze(void) {
+        sync();
+
         for (;;)
                 pause();
 }
@@ -3402,8 +3404,8 @@ bool null_or_empty(struct stat *st) {
         return false;
 }
 
-DIR *xopendirat(int fd, const char *name) {
-        return fdopendir(openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
+DIR *xopendirat(int fd, const char *name, int flags) {
+        return fdopendir(openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|flags));
 }
 
 int signal_from_string_try_harder(const char *s) {