From 8f6ce71fe79d897b67157d92869db87ee2042af6 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 18 Sep 2013 12:12:04 -0400 Subject: device-nodes: move device node specific code to own file In the process, rename udev_encode_string which is poorly named for what it does. It deals specifically with encoding names that udev creates and has its own rules: utf8 is valid but some ascii is not (e.g. path separators), and everything else is simply escaped. Rename it to encode_devnode_name. --- src/shared/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/shared/util.c') diff --git a/src/shared/util.c b/src/shared/util.c index 2b76a5c885..200955376e 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -73,7 +73,7 @@ #include "hashmap.h" #include "env-util.h" #include "fileio.h" -#include "utf8.h" +#include "device-nodes.h" int saved_argc = 0; char **saved_argv = NULL; @@ -3509,7 +3509,7 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) { if (t == NULL) return NULL; - if (udev_encode_string(u, t, enc_len) < 0) + if (encode_devnode_name(u, t, enc_len) < 0) return NULL; if (asprintf(&dn, "/dev/disk/by-%s/%s", by, t) < 0) -- cgit v1.2.3-54-g00ecf