X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fudev%2Fudevadm-info.c;h=2ee59fe07534df8c3e171adddb16d23d19dbeb2a;hb=5c11fbe3a75e8015f2c26736787d4279c091f091;hp=907e961f4a777b62a2fc1bc8a24ca4d53c2c58b2;hpb=4f5d327a49e1a40ae0a3b8f1855dc90f3c0d953f;p=elogind.git diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 907e961f4..2ee59fe07 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Kay Sievers + * Copyright (C) 2004-2009 Kay Sievers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ static bool skip_attribute(const char *name) { - static const char const *skip[] = { + static const char* const skip[] = { "uevent", "dev", "modalias", @@ -45,7 +45,7 @@ static bool skip_attribute(const char *name) unsigned int i; for (i = 0; i < ELEMENTSOF(skip); i++) - if (strcmp(name, skip[i]) == 0) + if (streq(name, skip[i])) return true; return false; } @@ -251,13 +251,13 @@ static void cleanup_db(struct udev *udev) closedir(dir); } - dir = opendir("/run/udev/watch"); + dir = opendir("/run/udev/static_node-tags"); if (dir != NULL) { - cleanup_dir(dir, 0, 1); + cleanup_dir(dir, 0, 2); closedir(dir); } - dir = opendir("/run/udev/firmware-missing"); + dir = opendir("/run/udev/watch"); if (dir != NULL) { cleanup_dir(dir, 0, 1); closedir(dir); @@ -269,7 +269,7 @@ static struct udev_device *find_device(struct udev *udev, const char *id, const char name[UTIL_PATH_SIZE]; if (prefix && !startswith(id, prefix)) { - util_strscpyl(name, sizeof(name), prefix, id, NULL); + strscpyl(name, sizeof(name), prefix, id, NULL); id = name; } @@ -393,15 +393,15 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) break; case 'q': action = ACTION_QUERY; - if (strcmp(optarg, "property") == 0 || strcmp(optarg, "env") == 0) { + if (streq(optarg, "property") || streq(optarg, "env")) { query = QUERY_PROPERTY; - } else if (strcmp(optarg, "name") == 0) { + } else if (streq(optarg, "name")) { query = QUERY_NAME; - } else if (strcmp(optarg, "symlink") == 0) { + } else if (streq(optarg, "symlink")) { query = QUERY_SYMLINK; - } else if (strcmp(optarg, "path") == 0) { + } else if (streq(optarg, "path")) { query = QUERY_PATH; - } else if (strcmp(optarg, "all") == 0) { + } else if (streq(optarg, "all")) { query = QUERY_ALL; } else { fprintf(stderr, "unknown query type\n"); @@ -414,7 +414,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[]) break; case 'd': action = ACTION_DEVICE_ID_FILE; - util_strscpy(name, sizeof(name), optarg); + strscpy(name, sizeof(name), optarg); break; case 'a': action = ACTION_ATTRIBUTE_WALK;