util-lib: add new path_is_temporary_fs() API

As simple wrapper around fd_is_temporary_fs().
This commit is contained in:
Lennart Poettering
2016-12-20 20:00:09 +01:00
parent ae59114af9
commit ffeb828596
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -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);
}