mirror of
https://github.com/systemd/systemd.git
synced 2026-07-11 18:13:31 +00:00
devnum-util: define helper macros for formatting devnum major/minor pairs
And port some parts over.
This commit is contained in:
@@ -49,7 +49,7 @@ int device_path_make_major_minor(mode_t mode, dev_t devnum, char **ret) {
|
||||
else
|
||||
return -ENODEV;
|
||||
|
||||
if (asprintf(ret, "/dev/%s/%u:%u", t, major(devnum), minor(devnum)) < 0)
|
||||
if (asprintf(ret, "/dev/%s/" DEVNUM_FORMAT_STR, t, DEVNUM_FORMAT_VAL(devnum)) < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user