diff options
Diffstat (limited to 'src/basic/stat-util.c')
-rw-r--r-- | src/basic/stat-util.c | 10 |
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); +} |