summaryrefslogtreecommitdiff
path: root/arch/um
diff options
context:
space:
mode:
authorGlenn Washburn <development@efficientek.com>2022-03-03 01:53:33 -0600
committerRichard Weinberger <richard@nod.at>2022-03-11 10:56:17 +0100
commit82017457957a550d7d00dde419435dd74a890887 (patch)
treec7a5ec0332ae472c2c6b98dd39a66ac154aefbe8 /arch/um
parent3cb5a7f167c620a8b0e38b0446df2e024d2243dc (diff)
um: run_helper: Write error message to kernel log on exec failure on host
The best place to log errors from the host side is in the kernel log within the UML guest. Letting the user now that exec() failed and why is very helpful when the user is trying to determine why some aspect of UML is not working. For instance, when telneting into the UML instance, if the connection is established and then immediately dropped, this may be due to exec() failing because in.telnetd is not found. Signed-off-by: Glenn Washburn <development@efficientek.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/os-Linux/helper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c
index 32e88baf18dd..b459745f52e2 100644
--- a/arch/um/os-Linux/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -4,6 +4,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sched.h>
@@ -99,6 +100,10 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
CATCH_EINTR(waitpid(pid, NULL, __WALL));
}
+ if (ret < 0)
+ printk(UM_KERN_ERR "run_helper : failed to exec %s on host: %s\n",
+ argv[0], strerror(-ret));
+
out_free2:
kfree(data.buf);
out_close: