Sfoglia il codice sorgente

wd: Report error when close of wd fails

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
(cherry picked from commit be3e16624902a5ca926a5d96a65514af7451bf2e)
Bin Liu 8 anni fa
parent
commit
e47ead9cd8
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      exec/wd.c

+ 3 - 1
exec/wd.c

@@ -753,7 +753,9 @@ static int wd_exec_exit_fn (void)
 
 	if (dog > 0) {
 		log_printf (LOGSYS_LEVEL_INFO, "magically closing the watchdog.");
-		write (dog, &magic, 1);
+		if (write (dog, &magic, 1) == -1) {
+		    log_printf (LOGSYS_LEVEL_ERROR, "failed to write %c to dog(%d).", magic, dog);
+		}
 	}
 	return 0;
 }