about summary refs log tree commit diff
path: root/xe.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-11-03 21:27:07 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-11-03 21:27:07 +0100
commitb7f0e3f6c0e748465efd79482dfb56d29caedc1b (patch)
tree7bdf7a9364121c73dc5e3f511d6bfa0232d255c2 /xe.c
parent102e13e2480d561b0ec536b0cf1ded44c3897566 (diff)
downloadxe-b7f0e3f6c0e748465efd79482dfb56d29caedc1b.tar.gz
xe-b7f0e3f6c0e748465efd79482dfb56d29caedc1b.tar.xz
xe-b7f0e3f6c0e748465efd79482dfb56d29caedc1b.zip
run: save errno before calling other functions
Diffstat (limited to 'xe.c')
-rw-r--r--xe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xe.c b/xe.c
index 728102c..5f93856 100644
--- a/xe.c
+++ b/xe.c
@@ -262,8 +262,9 @@ run()
 			}
 		}
 		execvp(args[0], args);
+		int status = (errno == ENOENT ? 127 : 126);
 		fprintf(stderr, "xe: %s: %s\n", args[0], strerror(errno));
-		exit(errno == ENOENT ? 127 : 126);
+		exit(status);
 	}
 	if (pid < 0)
 		exit(126);