summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2018-03-14 15:22:12 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-16 22:07:13 +0000
commit1e90a18a085e324b821a8bd0dc28a27082e43634 (patch)
tree563dbd09053d11ca8689dba24bfa61266f32fc3c /utils.h
parent3c488585bd9897c842c1708ddb413adee5a9b43a (diff)
downloadbubblewrap-1e90a18a085e324b821a8bd0dc28a27082e43634.tar.gz
Don't rely on mkdir returning EEXISTS (fixing NFS)
For NFS mounts if we call mkdir() on a read-only mount (such as when we've created a read-only bind mount) the kernel will nor return EEXIST even when the directory exists, instead returning EROFS. So, we add (and use) an ensure_dir() helper that stats before calling mkdir. Closes: #258 Approved by: giuseppe
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index c0b98bb..52cf772 100644
--- a/utils.h
+++ b/utils.h
@@ -101,6 +101,8 @@ int create_file (const char *path,
const char *content);
int ensure_file (const char *path,
mode_t mode);
+int ensure_dir (const char *path,
+ mode_t mode);
int get_file_mode (const char *pathname);
int mkdir_with_parents (const char *pathname,
int mode,