diff options
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/ata_id/ata_id.c | 3 | ||||
-rw-r--r-- | src/udev/scsi_id/scsi_id.c | 5 | ||||
-rw-r--r-- | src/udev/udev-builtin-usb_id.c | 9 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c index 9d22be81b2..0a7df45761 100644 --- a/src/udev/ata_id/ata_id.c +++ b/src/udev/ata_id/ata_id.c @@ -23,6 +23,7 @@ #include <sys/types.h> #include <unistd.h> +#include "device-nodes.h" #include "fd-util.h" #include "libudev-util.h" #include "log.h" @@ -483,7 +484,7 @@ int main(int argc, char *argv[]) { memcpy(model, id.model, 40); model[40] = '\0'; - udev_util_encode_string(model, model_enc, sizeof(model_enc)); + encode_devnode_name(model, model_enc, sizeof(model_enc)); udev_replace_whitespace((char *) id.model, model, 40); udev_replace_chars(model, NULL); udev_replace_whitespace((char *) id.serial_no, serial, 20); diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c index 5d61e38d5e..f5856f2293 100644 --- a/src/udev/scsi_id/scsi_id.c +++ b/src/udev/scsi_id/scsi_id.c @@ -18,6 +18,7 @@ #include "alloc-util.h" #include "build.h" +#include "device-nodes.h" #include "fd-util.h" #include "libudev-util.h" #include "scsi_id.h" @@ -453,8 +454,8 @@ static int set_inq_values(struct scsi_id_device *dev_scsi, const char *path) { if (retval) return retval; - udev_util_encode_string(dev_scsi->vendor, vendor_enc_str, sizeof(vendor_enc_str)); - udev_util_encode_string(dev_scsi->model, model_enc_str, sizeof(model_enc_str)); + encode_devnode_name(dev_scsi->vendor, vendor_enc_str, sizeof(vendor_enc_str)); + encode_devnode_name(dev_scsi->model, model_enc_str, sizeof(model_enc_str)); udev_replace_whitespace(dev_scsi->vendor, vendor_str, sizeof(vendor_str)-1); udev_replace_chars(vendor_str, NULL); diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c index 75915ab39c..c0558561dc 100644 --- a/src/udev/udev-builtin-usb_id.c +++ b/src/udev/udev-builtin-usb_id.c @@ -15,6 +15,7 @@ #include <unistd.h> #include "alloc-util.h" +#include "device-nodes.h" #include "device-util.h" #include "fd-util.h" #include "libudev-util.h" @@ -329,7 +330,7 @@ static int builtin_usb_id(sd_device *dev, int argc, char *argv[], bool test) { log_device_debug_errno(dev_scsi, r, "Failed to get SCSI vendor attribute: %m"); goto fallback; } - udev_util_encode_string(scsi_vendor, vendor_str_enc, sizeof(vendor_str_enc)); + encode_devnode_name(scsi_vendor, vendor_str_enc, sizeof(vendor_str_enc)); udev_replace_whitespace(scsi_vendor, vendor_str, sizeof(vendor_str)-1); udev_replace_chars(vendor_str, NULL); @@ -338,7 +339,7 @@ static int builtin_usb_id(sd_device *dev, int argc, char *argv[], bool test) { log_device_debug_errno(dev_scsi, r, "Failed to get SCSI model attribute: %m"); goto fallback; } - udev_util_encode_string(scsi_model, model_str_enc, sizeof(model_str_enc)); + encode_devnode_name(scsi_model, model_str_enc, sizeof(model_str_enc)); udev_replace_whitespace(scsi_model, model_str, sizeof(model_str)-1); udev_replace_chars(model_str, NULL); @@ -379,7 +380,7 @@ fallback: if (sd_device_get_sysattr_value(dev_usb, "manufacturer", &usb_vendor) < 0) usb_vendor = vendor_id; - udev_util_encode_string(usb_vendor, vendor_str_enc, sizeof(vendor_str_enc)); + encode_devnode_name(usb_vendor, vendor_str_enc, sizeof(vendor_str_enc)); udev_replace_whitespace(usb_vendor, vendor_str, sizeof(vendor_str)-1); udev_replace_chars(vendor_str, NULL); } @@ -389,7 +390,7 @@ fallback: if (sd_device_get_sysattr_value(dev_usb, "product", &usb_model) < 0) usb_model = product_id; - udev_util_encode_string(usb_model, model_str_enc, sizeof(model_str_enc)); + encode_devnode_name(usb_model, model_str_enc, sizeof(model_str_enc)); udev_replace_whitespace(usb_model, model_str, sizeof(model_str)-1); udev_replace_chars(model_str, NULL); } |