Преглед на файлове

totemknet: Handle logpipe creation failure

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Bin Liu преди 9 години
родител
ревизия
725f9039e9
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      exec/totemknet.c

+ 5 - 1
exec/totemknet.c

@@ -855,7 +855,11 @@ int totemknet_initialize (
 
 	instance->totemknet_target_set_completed = target_set_completed;
 
-	pipe(instance->logpipes);
+	res = pipe(instance->logpipes);
+	if (res == -1) {
+	    KNET_LOGSYS_PERROR(errno, LOGSYS_LEVEL_CRIT, "failed to create pipe for instance->logpipes");
+	    return -1;
+	}
 	fcntl(instance->logpipes[0], F_SETFL, O_NONBLOCK);
 	fcntl(instance->logpipes[1], F_SETFL, O_NONBLOCK);