chiark / gitweb /
swap: don't add mount links for swap devices
[elogind.git] / util.c
diff --git a/util.c b/util.c
index 5e3654d1d1ff383d96ec5de86381e85ed8a41d37..f7d538aaacf87496367661ba3822bc2f44cb6070 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1927,6 +1927,16 @@ bool is_clean_exit(int code, int status) {
         return false;
 }
 
+bool is_device_path(const char *path) {
+
+        /* Returns true on paths that refer to a device, either in
+         * sysfs or in /dev */
+
+        return
+                path_startswith(path, "/dev/") ||
+                path_startswith(path, "/sys/");
+}
+
 static const char *const ioprio_class_table[] = {
         [IOPRIO_CLASS_NONE] = "none",
         [IOPRIO_CLASS_RT] = "realtime",