about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--xe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xe.c b/xe.c
index 30231eb..3e0bc35 100644
--- a/xe.c
+++ b/xe.c
@@ -271,9 +271,10 @@ run()
 		int status = (errno == ENOENT ? 127 : 126);
 		fprintf(stderr, "xe: %s: %s\n", args[0], strerror(errno));
 		exit(status);
-	}
-	if (pid < 0)
+	} else if (pid < 0) {  // fork failed
+		fprintf(stderr, "xe: %s: %s\n", args[0], strerror(errno));
 		exit(126);
+	}
 
 	if (Lflag) {
 		long iter = iterations;