diff options
author | Martin Wilck <mwilck@arcor.de> | 2013-07-30 23:18:31 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-07-31 04:59:40 +0200 |
commit | c371936051db7fcbe512a771b3a7bf866c1e2981 (patch) | |
tree | a10a09efed4fbe3597fffd56694617465fda8d30 /monitor.c | |
parent | monitor: read_and_act: log status when called (diff) | |
download | mdadm-c371936051db7fcbe512a771b3a7bf866c1e2981.tar.xz mdadm-c371936051db7fcbe512a771b3a7bf866c1e2981.zip |
mdmon: wait_and_act: fix debug message for SIGUSR1
Correctly print out wake reason if it was a signal. Previous code
would print misleading select events (pselect(2) man page says the
fdsets become undefined in case of error).
Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -640,10 +640,17 @@ static int wait_and_act(struct supertype *container, int nowait) monitor_loop_cnt |= 1; rv = pselect(maxfd+1, NULL, NULL, &rfds, &ts, &set); monitor_loop_cnt += 1; - if (rv == -1 && errno == EINTR) - rv = 0; + if (rv == -1) { + if (errno == EINTR) { + rv = 0; + dprintf("monitor: caught signal\n"); + } else + dprintf("monitor: error %d in pselect\n", + errno); + } #ifdef DEBUG - dprint_wake_reasons(&rfds); + else + dprint_wake_reasons(&rfds); #endif container->retry_soon = 0; } |