diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-02 20:22:16 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-04 08:51:39 +0200 |
commit | 78d8eae9a58c72ee6dfad13ceb4698c38a07764f (patch) | |
tree | 2a6c097befb6b8504dfb50b23c899e84eb7f273c /src/udev | |
parent | util: move device-node.[ch] to shared (diff) | |
download | systemd-78d8eae9a58c72ee6dfad13ceb4698c38a07764f.tar.xz systemd-78d8eae9a58c72ee6dfad13ceb4698c38a07764f.zip |
util: drop DEV_NUM_PATH_MAX and xsprintf_dev_num_path()
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-node.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index d90c933988..a56084de7e 100644 --- a/src/udev/udev-node.c +++ b/src/udev/udev-node.c @@ -10,7 +10,6 @@ #include "sd-id128.h" #include "alloc-util.h" -#include "device-nodes.h" #include "device-private.h" #include "device-util.h" #include "dirent-util.h" @@ -517,7 +516,6 @@ static int node_permissions_apply(sd_device *dev, bool apply_mac, } static int xsprintf_dev_num_path_from_sd_device(sd_device *dev, char **ret) { - char filename[DEV_NUM_PATH_MAX], *s; const char *subsystem; dev_t devnum; int r; @@ -532,16 +530,7 @@ static int xsprintf_dev_num_path_from_sd_device(sd_device *dev, char **ret) { if (r < 0) return r; - xsprintf_dev_num_path(filename, - streq(subsystem, "block") ? "block" : "char", - devnum); - - s = strdup(filename); - if (!s) - return -ENOMEM; - - *ret = s; - return 0; + return device_path_make_major_minor(streq(subsystem, "block") ? S_IFBLK : S_IFCHR, devnum, ret); } int udev_node_add(sd_device *dev, bool apply, |