summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-02-19 10:51:37 +0100
committerAlexander Larsson <alexl@redhat.com>2016-02-19 10:51:37 +0100
commitc3dd820adff53837967e62497fa903bc9ff6b167 (patch)
tree4ac6f6fb0a006df72b1cf598682976802420dc8e /utils.h
parent57f9d6c29416b7252085ddf41644b65f783e82f7 (diff)
downloadbubblewrap-c3dd820adff53837967e62497fa903bc9ff6b167.tar.gz
When creating file bind mount destinations, check if they already exist
If they already exist as a regular file then we don't need to create it, which is good because doing so would break if the filesystem is readonly. I.e. that returns EROFS instead of EEXISTS in that case.
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 915bed3..1cfe93a 100644
--- a/utils.h
+++ b/utils.h
@@ -89,6 +89,8 @@ int copy_file (const char *src_path,
int create_file (const char *path,
mode_t mode,
const char *content);
+int ensure_file (const char *path,
+ mode_t mode);
int get_file_mode (const char *pathname);
int mkdir_with_parents (const char *pathname,
int mode,