X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev%2Fudevadm.c;h=2a2915891797dcba2b17940ed7db701722b7e7e4;hb=7236c6c40a730d053141d9fe797dc65dc2ecd1f1;hp=21b7f616c3e11c04995841ead06e0d3a59efad29;hpb=d5a01cb8b31bd0791d1617c56d4c669a02018bd7;p=elogind.git diff --git a/udev/udevadm.c b/udev/udevadm.c index 21b7f616c..2a2915891 100644 --- a/udev/udevadm.c +++ b/udev/udevadm.c @@ -25,7 +25,7 @@ #include "udev.h" -static int debug; +static bool debug; static void log_fn(struct udev *udev, int priority, const char *file, int line, const char *fn, @@ -101,7 +101,7 @@ static const struct command cmds[] = { .name = "test", .cmd = udevadm_test, .help = "simulation run", - .debug = 1, + .debug = true, }, { .name = "version", @@ -117,7 +117,7 @@ static const struct command cmds[] = { static int run_command(struct udev *udev, const struct command *cmd, int argc, char *argv[]) { if (cmd->debug) { - debug = 1; + debug = true; if (udev_get_log_priority(udev) < LOG_INFO) udev_set_log_priority(udev, LOG_INFO); } @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) udev_set_log_fn(udev, log_fn); udev_selinux_init(udev); - while (1) { + for (;;) { int option; option = getopt_long(argc, argv, "+dhV", options, NULL); @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) switch (option) { case 'd': - debug = 1; + debug = true; if (udev_get_log_priority(udev) < LOG_INFO) udev_set_log_priority(udev, LOG_INFO); break; @@ -171,6 +171,8 @@ int main(int argc, char *argv[]) } command = argv[optind]; + info(udev, "runtime dir '%s'\n", udev_get_run_path(udev)); + if (command != NULL) for (i = 0; cmds[i].cmd != NULL; i++) { if (strcmp(cmds[i].name, command) == 0) {