linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: md@Linux.IT (Marco d'Itri)
To: linux-hotplug@vger.kernel.org
Subject: verbosity of udevadm
Date: Mon, 14 Sep 2009 00:42:00 +0000	[thread overview]
Message-ID: <20090914004200.GA22490@bongo.bofh.it> (raw)

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

This patch prints to stderr all messages with priority higher or equal
than LOG_ERR.
It is needed to prevent errors in libudev from going unnoticed (e.g.
when udevd is not running).

-- 
ciao,
Marco

[-- Attachment #2: udevadm_print_errors --]
[-- Type: text/plain, Size: 2924 bytes --]

--- a/udev/udevadm.c
+++ b/udev/udevadm.c
@@ -35,6 +35,8 @@ static void log_fn(struct udev *udev, in
 		fprintf(stderr, "%s: ", fn);
 		vfprintf(stderr, format, args);
 	} else {
+		if (priority <= LOG_ERR)
+			vfprintf(stderr, format, args);
 		vsyslog(priority, format, args);
 	}
 }
@@ -162,8 +164,6 @@ int main(int argc, char *argv[])
 			len = readlink(path, prog, sizeof(prog));
 			if (len > 0) {
 				prog[len] = '\0';
-				fprintf(stderr, "the program '%s' called '%s', it should use 'udevadm %s <options>', "
-				       "this will stop working in a future release\n", prog, argv[0], command);
 				err(udev, "the program '%s' called '%s', it should use 'udevadm %s <options>', "
 				    "this will stop working in a future release\n", prog, argv[0], command);
 			}
--- a/udev/udevadm-control.c
+++ b/udev/udevadm-control.c
@@ -81,8 +81,6 @@ int udevadm_control(struct udev *udev, i
 			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, i
 	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, i
 	}
 
 	if (rc != 0) {
-		fprintf(stderr, "unrecognized command\n");
 		err(udev, "unrecognized command\n");
 	}
 exit:
--- a/udev/udevadm-settle.c
+++ b/udev/udevadm-settle.c
@@ -139,14 +139,12 @@ int udevadm_settle(struct udev *udev, in
 
 		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;
 		}
@@ -154,7 +152,6 @@ int udevadm_settle(struct udev *udev, in
 	} 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;
 		}
 	}
--- a/udev/udevadm-trigger.c
+++ b/udev/udevadm-trigger.c
@@ -146,7 +146,6 @@ int udevadm_trigger(struct udev *udev, i
 			} 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;

             reply	other threads:[~2009-09-14  0:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14  0:42 Marco d'Itri [this message]
2009-09-14 11:58 ` verbosity of udevadm Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090914004200.GA22490@bongo.bofh.it \
    --to=md@linux.it \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).