summaryrefslogtreecommitdiffstats
path: root/src/basic/stat-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-08 19:39:50 +0100
committerLennart Poettering <lennart@poettering.net>2016-12-20 20:00:09 +0100
commitffeb828596ebc9e5b20333c72862569b8b0875ad (patch)
tree793d48be362a52d33fa7fc4745f5318c200753e6 /src/basic/stat-util.c
parentgpt-auto-generator: rename add_boot() → add_esp() (diff)
downloadsystemd-ffeb828596ebc9e5b20333c72862569b8b0875ad.tar.xz
systemd-ffeb828596ebc9e5b20333c72862569b8b0875ad.zip
util-lib: add new path_is_temporary_fs() API
As simple wrapper around fd_is_temporary_fs().
Diffstat (limited to 'src/basic/stat-util.c')
-rw-r--r--src/basic/stat-util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
index 848572687e..ac5db71022 100644
--- a/src/basic/stat-util.c
+++ b/src/basic/stat-util.c
@@ -224,3 +224,13 @@ int fd_is_temporary_fs(int fd) {
return is_temporary_fs(&s);
}
+
+int path_is_temporary_fs(const char *path) {
+ _cleanup_close_ int fd = -1;
+
+ fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY);
+ if (fd < 0)
+ return -errno;
+
+ return fd_is_temporary_fs(fd);
+}