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>
#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>
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(".");