summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-blkid.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-04-16 20:27:44 +0200
committerKay Sievers <kay@vrfy.org>2012-04-16 20:54:17 +0200
commit33502ffe2eb7b56cdd018a4fb6830d7828519fad (patch)
tree02180c0a82618b09f7346edaa7b28dd93eb81c9f /src/udev/udev-builtin-blkid.c
parent6ada823a9a0979ea145fd70add1007c21caa45c0 (diff)
downloadsystemd-33502ffe2eb7b56cdd018a4fb6830d7828519fad.tar.gz
udev: use startswith() and streq()
Diffstat (limited to 'src/udev/udev-builtin-blkid.c')
-rw-r--r--src/udev/udev-builtin-blkid.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c
index fdc68d00a8..39f286a745 100644
--- a/src/udev/udev-builtin-blkid.c
+++ b/src/udev/udev-builtin-blkid.c
@@ -37,45 +37,45 @@ static void print_property(struct udev_device *dev, bool test, const char *name,
s[0] = '\0';
- if (!strcmp(name, "TYPE")) {
+ if (streq(name, "TYPE")) {
udev_builtin_add_property(dev, test, "ID_FS_TYPE", value);
- } else if (!strcmp(name, "USAGE")) {
+ } else if (streq(name, "USAGE")) {
udev_builtin_add_property(dev, test, "ID_FS_USAGE", value);
- } else if (!strcmp(name, "VERSION")) {
+ } else if (streq(name, "VERSION")) {
udev_builtin_add_property(dev, test, "ID_FS_VERSION", value);
- } else if (!strcmp(name, "UUID")) {
+ } else if (streq(name, "UUID")) {
blkid_safe_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_FS_UUID", s);
blkid_encode_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_FS_UUID_ENC", s);
- } else if (!strcmp(name, "UUID_SUB")) {
+ } else if (streq(name, "UUID_SUB")) {
blkid_safe_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_FS_UUID_SUB", s);
blkid_encode_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_FS_UUID_SUB_ENC", s);
- } else if (!strcmp(name, "LABEL")) {
+ } else if (streq(name, "LABEL")) {
blkid_safe_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_FS_LABEL", s);
blkid_encode_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_FS_LABEL_ENC", s);
- } else if (!strcmp(name, "PTTYPE")) {
+ } else if (streq(name, "PTTYPE")) {
udev_builtin_add_property(dev, test, "ID_PART_TABLE_TYPE", value);
- } else if (!strcmp(name, "PART_ENTRY_NAME")) {
+ } else if (streq(name, "PART_ENTRY_NAME")) {
blkid_encode_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_PART_ENTRY_NAME", s);
- } else if (!strcmp(name, "PART_ENTRY_TYPE")) {
+ } else if (streq(name, "PART_ENTRY_TYPE")) {
blkid_encode_string(value, s, sizeof(s));
udev_builtin_add_property(dev, test, "ID_PART_ENTRY_TYPE", s);
- } else if (!strncmp(name, "PART_ENTRY_", 11)) {
+ } else if (startswith(name, "PART_ENTRY_")) {
util_strscpyl(s, sizeof(s), "ID_", name, NULL);
udev_builtin_add_property(dev, test, s, value);
}