open might return EINTR
authorRobert Swiecki <robert@swiecki.net>
Sat, 5 Jan 2019 23:03:36 +0000 (00:03 +0100)
committerRobert Swiecki <robert@swiecki.net>
Sat, 5 Jan 2019 23:03:36 +0000 (00:03 +0100)
util.cc

diff --git a/util.cc b/util.cc
index e271e9d..35e1749 100644 (file)
--- a/util.cc
+++ b/util.cc
@@ -118,7 +118,7 @@ bool createDirRecursively(const char* dir) {
                return false;
        }
 
-       int prev_dir_fd = open("/", O_RDONLY | O_CLOEXEC);
+       int prev_dir_fd = TEMP_FAILURE_RETRY(open("/", O_RDONLY | O_CLOEXEC | O_DIRECTORY));
        if (prev_dir_fd == -1) {
                PLOG_W("open('/', O_RDONLY | O_CLOEXEC)");
                return false;