devnum-util: add new devnum_is_zero() helper

This commit is contained in:
Lennart Poettering
2023-03-29 18:27:05 +02:00
parent d83ce13636
commit d80e2a1ed3
4 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ int device_path_make_canonical(mode_t mode, dev_t devnum, char **ret) {
assert(ret);
if (major(devnum) == 0 && minor(devnum) == 0)
if (devnum_is_zero(devnum))
/* A special hack to make sure our 'inaccessible' device nodes work. They won't have symlinks in
* /dev/block/ and /dev/char/, hence we handle them specially here. */
return device_path_make_inaccessible(mode, ret);