diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-11-03 21:27:07 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-11-03 21:27:07 +0100 |
commit | b7f0e3f6c0e748465efd79482dfb56d29caedc1b (patch) | |
tree | 7bdf7a9364121c73dc5e3f511d6bfa0232d255c2 /xe.c | |
parent | 102e13e2480d561b0ec536b0cf1ded44c3897566 (diff) | |
download | xe-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.c | 3 |
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); |