summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-test-builtin.c
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2014-01-13 18:16:50 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-01-13 18:16:50 -0500
commite33d2cfc5e0bafb10eb82bb32776c41e558a026c (patch)
tree619ae0451cd40f169d740a02f26bf46a17c854b1 /src/udev/udevadm-test-builtin.c
parent248ea81923ce671979ccbe0bca5683d4239feb70 (diff)
src/udev: bring up to date with upstream.
These commits were authored by Zbigniew Jędrzejewski-Szmek Tom Gundersen Kay Sievers Lennart Poettering Shawn Landden Daniel Buch Martin Pitt Karel Zak Yang Zhiyong Note: udev_builtin_net_setup_link has *not* been imported. Also still missing from udev-builtin is udev_builtin_uaccess. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udevadm-test-builtin.c')
-rw-r--r--src/udev/udevadm-test-builtin.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c
index a02efe5ac3..7d68722569 100644
--- a/src/udev/udevadm-test-builtin.c
+++ b/src/udev/udevadm-test-builtin.c
@@ -37,7 +37,7 @@
static void help(struct udev *udev)
{
fprintf(stderr, "\n");
- fprintf(stderr, "Usage: udevadm builtin [--help] <command> <syspath>\n");
+ fprintf(stderr, "Usage: udevadm builtin [--help] COMMAND SYSPATH\n");
udev_builtin_list(udev);
fprintf(stderr, "\n");
}
@@ -53,21 +53,14 @@ static int adm_builtin(struct udev *udev, int argc, char *argv[])
char filename[UTIL_PATH_SIZE];
struct udev_device *dev = NULL;
enum udev_builtin_cmd cmd;
- int rc = EXIT_SUCCESS;
+ int rc = EXIT_SUCCESS, c;
- for (;;) {
- int option;
-
- option = getopt_long(argc, argv, "h", options, NULL);
- if (option == -1)
- break;
-
- switch (option) {
+ while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0)
+ switch (c) {
case 'h':
help(udev);
goto out;
}
- }
command = argv[optind++];
if (command == NULL) {
@@ -79,7 +72,7 @@ static int adm_builtin(struct udev *udev, int argc, char *argv[])
syspath = argv[optind++];
if (syspath == NULL) {
- fprintf(stderr, "syspath missing\n\n");
+ fprintf(stderr, "syspath missing\n");
rc = 3;
goto out;
}