]> err.no Git - systemd/commitdiff
udevadm: print all messages to stderr with priority higher or equal than LOG_ERR
authorMarco d'Itri <md@linux.it>
Mon, 14 Sep 2009 11:56:38 +0000 (13:56 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 14 Sep 2009 11:56:38 +0000 (13:56 +0200)
It is needed to prevent errors in udev from going unnoticed (e.g.
when udevd is not running).

udev/udevadm-control.c
udev/udevadm-settle.c
udev/udevadm-trigger.c
udev/udevadm.c

index 3eb03d8b04d63c48d990d62221db1725ec58e5c7..42818d9db74e4fcac941605dbb93ecc5f2b1ebd6 100644 (file)
@@ -81,8 +81,6 @@ int udevadm_control(struct udev *udev, int argc, char *argv[])
                        break;
 
                if (option > 255) {
-                       fprintf(stderr, "udevadm control expects commands without underscore, "
-                               "this will stop working in a future release\n");
                        err(udev, "udevadm control expects commands without underscore, "
                            "this will stop working in a future release\n");
                }
@@ -144,8 +142,6 @@ int udevadm_control(struct udev *udev, int argc, char *argv[])
        if (argv[optind] != NULL) {
                const char *arg = argv[optind];
 
-               fprintf(stderr, "udevadm control commands requires the --<command> format, "
-                       "this will stop working in a future release\n");
                err(udev, "udevadm control commands requires the --<command> format, "
                    "this will stop working in a future release\n");
 
@@ -177,7 +173,6 @@ int udevadm_control(struct udev *udev, int argc, char *argv[])
        }
 
        if (rc != 0) {
-               fprintf(stderr, "unrecognized command\n");
                err(udev, "unrecognized command\n");
        }
 exit:
index 124c59698c491ab04e9b9ecd2722738ad544286d..5030f18602c9e8a8bd3163b80f6b1f5379987157 100644 (file)
@@ -140,14 +140,12 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
 
                if (start > end) {
                        err(udev, "seq-start larger than seq-end, ignoring\n");
-                       fprintf(stderr, "seq-start larger than seq-end, ignoring\n");
                        start = 0;
                        end = 0;
                }
 
                if (start > kernel_seq || end > kernel_seq) {
                        err(udev, "seq-start or seq-end larger than current kernel value, ignoring\n");
-                       fprintf(stderr, "seq-start or seq-end larger than current kernel value, ignoring\n");
                        start = 0;
                        end = 0;
                }
@@ -155,7 +153,6 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
        } else {
                if (end > 0) {
                        err(udev, "seq-end needs seq-start parameter, ignoring\n");
-                       fprintf(stderr, "seq-end needs seq-start parameter, ignoring\n");
                        end = 0;
                }
        }
index 8a626ec7446a7fef9884ce5471c529665e0b946b..dbcaee3dbd59299141081a55bd9fdc9748f07e7c 100644 (file)
@@ -146,7 +146,6 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[])
                        } else if (strcmp(optarg, "failed") == 0) {
                                device_type = TYPE_FAILED;
                        } else {
-                               fprintf(stderr, "unknown type --type=%s\n", optarg);
                                err(udev, "unknown type --type=%s\n", optarg);
                                rc = 2;
                                goto exit;
index 452489a0c752c4087fcf52be4772cfe770e33197..3d94215ba97d04524516eca820354304973f5262 100644 (file)
@@ -35,6 +35,8 @@ static void log_fn(struct udev *udev, int priority,
                fprintf(stderr, "%s: ", fn);
                vfprintf(stderr, format, args);
        } else {
+               if (priority <= LOG_ERR)
+                       vfprintf(stderr, format, args);
                vsyslog(priority, format, args);
        }
 }