diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2022-11-08 14:43:25 +0200 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-11-10 20:30:59 +0000 |
commit | 039b88f75367203e540009cc97603b1bce3fafa6 (patch) | |
tree | 87e229a158b4a239fc56d2112f6738c08de62d29 | |
parent | 93b2c2d5ed4ca369a9ea48163024125b958212b5 (diff) | |
download | procd-039b88f75367203e540009cc97603b1bce3fafa6.tar.gz |
sysupgrade: print errno on failure
The error message "Failed to exec upgraded." is not very informative.
Add errno to the message to make it more useful.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
-rw-r--r-- | sysupgrade.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sysupgrade.c b/sysupgrade.c index fc588b0..96a29e9 100644 --- a/sysupgrade.c +++ b/sysupgrade.c @@ -19,8 +19,10 @@ #include "sysupgrade.h" #include <ctype.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <unistd.h> #include <libubox/blobmsg.h> @@ -103,7 +105,7 @@ void sysupgrade_exec_upgraded(const char *prefix, char *path, execvp(argv[0], argv); /* Cleanup on failure */ - fprintf(stderr, "Failed to exec upgraded.\n"); + fprintf(stderr, "Failed to exec upgraded: %s\n", strerror(-errno)); unsetenv("WDTFD"); watchdog_set_cloexec(true); ret = chroot("."); |