Browse Source

totemknet: Handle logpipe creation failure

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Bin Liu 8 years ago
parent
commit
725f9039e9
1 changed files with 5 additions and 1 deletions
  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;
 	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[0], F_SETFL, O_NONBLOCK);
 	fcntl(instance->logpipes[1], F_SETFL, O_NONBLOCK);
 	fcntl(instance->logpipes[1], F_SETFL, O_NONBLOCK);