chiark / gitweb /
machine-id-setup: add a machine_id_commit call to commit on disk a transient machine-id
[elogind.git] / src / shared / util.c
index 21651708d55ba033346db88c164f05752e90e1f8..4fcbab97bed67eefaeea956708d5cc2d9f916abe 100644 (file)
@@ -3052,6 +3052,15 @@ _pure_ static int is_temporary_fs(struct statfs *s) {
                F_TYPE_EQUAL(s->f_type, RAMFS_MAGIC);
 }
 
+int is_fd_on_temporary_fs(int fd) {
+        struct statfs s;
+
+        if (fstatfs(fd, &s) < 0)
+                return -errno;
+
+        return is_temporary_fs(&s);
+}
+
 int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev) {
         struct statfs s;