]> err.no Git - systemd/commitdiff
udevadm: test - use printf() instead of info() for non-debug output
authorKay Sievers <kay.sievers@vrfy.org>
Sun, 17 Apr 2011 20:09:08 +0000 (22:09 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sun, 17 Apr 2011 20:09:08 +0000 (22:09 +0200)
udev/udevadm-test.c
udev/udevadm.c

index 4db70c49ddb68f44c245facaf6d53eb9d1285076..4137ce91fa5f58d7ab557937803448365929392b 100644 (file)
@@ -114,17 +114,17 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
        err = udev_event_execute_rules(event, rules);
 
        if (udev_device_get_event_timeout(dev) >= 0)
-               info(udev, "custom event timeout: %i\n", udev_device_get_event_timeout(dev));
+               printf("custom event timeout: %i\n", udev_device_get_event_timeout(dev));
 
        udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
-               info(udev, "%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
+               printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
 
        if (err == 0)
                udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
                        char program[UTIL_PATH_SIZE];
 
                        udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program));
-                       info(udev, "run: '%s'\n", program);
+                       printf("run: '%s'\n", program);
                }
        udev_event_unref(event);
        udev_device_unref(dev);
index 336d72370546307e1986ca098961bf3d18adcf41..2a2915891797dcba2b17940ed7db701722b7e7e4 100644 (file)
@@ -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);
        }
@@ -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;