]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: Obey "space protocol" when writing to syslog.
authorNeilBrown <neilb@suse.de>
Tue, 7 Apr 2015 23:17:17 +0000 (09:17 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 7 Apr 2015 23:17:17 +0000 (09:17 +1000)
"alert" treats the "disc" arg differently if it starts with a space.

At least it does for sending email.  It doesn't for writing to syslog.

Make this consistent and obey the 'space protocol' when writing to
syslog.

Signed-off-by: NeilBrown <neilb@suse.de>
Monitor.c

index 50ff7ecba117cf545b0f3158b4ac3d751f714e72..3647768a5a17898edcd8b0651695a2fb521ba17a 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -426,9 +426,13 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info)
                else
                        priority = LOG_INFO;
 
-               if (disc)
+               if (disc && disc[0] != ' ')
                        syslog(priority,
                               "%s event detected on md device %s, component device %s", event, dev, disc);
+               else if (disc)
+                       syslog(priority,
+                              "%s event detected on md device %s: %s",
+                              event, dev, disc);
                else
                        syslog(priority,
                               "%s event detected on md device %s",