diff options
author | Jo-Philipp Wich <jo@mein.io> | 2016-10-17 13:10:07 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2016-10-17 13:10:07 +0200 |
commit | e5f83dcc1b5037d8adc9dab70ddda541267647d0 (patch) | |
tree | 6b5716338de8b6385dc915b156d4ad47881f14fc | |
parent | d81972b85738dc54b947f23e1e22bcfe462c8bf4 (diff) | |
download | fstools-e5f83dcc1b5037d8adc9dab70ddda541267647d0.tar.gz |
probe: stop handling name property
In the full liblkid there is no tag called "NAME" and the name value reported
by libblkid-tiny was just the kind of uuid passed to blkid_probe_set_uuid_as().
Strip any handling of this property to allow removing it from libblkid-tiny.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | probe-libblkid.c | 13 | ||||
-rw-r--r-- | probe.c | 6 | ||||
-rw-r--r-- | probe.h | 1 |
3 files changed, 4 insertions, 16 deletions
diff --git a/probe-libblkid.c b/probe-libblkid.c index c448888..ad9f371 100644 --- a/probe-libblkid.c +++ b/probe-libblkid.c @@ -55,9 +55,9 @@ probe_path_libblkid(const char *path) { blkid_probe pr; struct probe_info *info = NULL; - size_t type_len, uuid_len, label_len, name_len, version_len; - char *dev_ptr, *type_ptr, *uuid_ptr, *label_ptr, *name_ptr, *version_ptr; - const char *type_val, *uuid_val, *label_val, *name_val, *version_val; + size_t type_len, uuid_len, label_len, version_len; + char *dev_ptr, *type_ptr, *uuid_ptr, *label_ptr, *version_ptr; + const char *type_val, *uuid_val, *label_val, *version_val; if (!load_libblkid()) return NULL; @@ -77,9 +77,6 @@ probe_path_libblkid(const char *path) if (libblkid.lookup(pr, "LABEL", &label_val, &label_len)) label_len = 0; - if (libblkid.lookup(pr, "NAME", &name_val, &name_len)) - name_len = 0; - if (libblkid.lookup(pr, "VERSION", &version_val, &version_len)) version_len = 0; @@ -89,7 +86,6 @@ probe_path_libblkid(const char *path) &type_ptr, type_len, &uuid_ptr, uuid_len, &label_ptr, label_len, - &name_ptr, name_len, &version_ptr, version_len); if (info) { @@ -102,9 +98,6 @@ probe_path_libblkid(const char *path) if (label_len) info->label = strcpy(label_ptr, label_val); - if (name_len) - info->name = strcpy(name_ptr, name_val); - if (version_len) info->version = strcpy(version_ptr, version_val); } @@ -22,7 +22,7 @@ probe_path_tiny(const char *path) { struct probe_info *info = NULL; struct blkid_struct_probe pr = { }; - char *type, *dev, *uuid, *label, *name, *version; + char *type, *dev, *uuid, *label, *version; if (probe_block((char *)path, &pr) == 0 && pr.id && !pr.err) { info = calloc_a(sizeof(*info), @@ -30,7 +30,6 @@ probe_path_tiny(const char *path) &dev, strlen(pr.dev) + 1, &uuid, strlen(pr.uuid) + 1, &label, strlen(pr.label) + 1, - &name, strlen(pr.name) + 1, &version, strlen(pr.version) + 1); if (info) { @@ -45,9 +44,6 @@ probe_path_tiny(const char *path) if (pr.label[0]) info->label = strcpy(label, pr.label); - if (pr.name[0]) - info->name = strcpy(name, pr.name); - if (pr.version[0]) info->version = strcpy(version, pr.version); } @@ -23,7 +23,6 @@ struct probe_info { char *dev; char *uuid; char *label; - char *name; char *version; }; |