summaryrefslogtreecommitdiffstats
path: root/Monitor.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-04-08 01:17:17 +0200
committerNeilBrown <neilb@suse.de>2015-04-08 01:17:17 +0200
commitb033913a3cc3cdd2c1dea9a9fcb13e6c463a689a (patch)
tree9972a751a21362709331ad24b87f8dc354ebe919 /Monitor.c
parentreshape: support raid5 grow on certain older kernels. (diff)
downloadmdadm-b033913a3cc3cdd2c1dea9a9fcb13e6c463a689a.tar.xz
mdadm-b033913a3cc3cdd2c1dea9a9fcb13e6c463a689a.zip
Monitor: Obey "space protocol" when writing to syslog.
"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>
Diffstat (limited to 'Monitor.c')
-rw-r--r--Monitor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Monitor.c b/Monitor.c
index 50ff7ecb..3647768a 100644
--- 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",