X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=util.c;fp=util.c;h=f7d538aaacf87496367661ba3822bc2f44cb6070;hp=5e3654d1d1ff383d96ec5de86381e85ed8a41d37;hb=8407a5d0183d9513349754f1eac86e2fdec8bd76;hpb=d4e6a6f66b7b3c797a1446816b8512d82c92278f diff --git a/util.c b/util.c index 5e3654d1d..f7d538aaa 100644 --- 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",