Skip to content

Commit 8201745

Browse files
crassrichardweinberger
authored andcommitted
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>
1 parent 3cb5a7f commit 8201745

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/um/os-Linux/helper.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <stdlib.h>
7+
#include <string.h>
78
#include <unistd.h>
89
#include <errno.h>
910
#include <sched.h>
@@ -99,6 +100,10 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
99100
CATCH_EINTR(waitpid(pid, NULL, __WALL));
100101
}
101102

103+
if (ret < 0)
104+
printk(UM_KERN_ERR "run_helper : failed to exec %s on host: %s\n",
105+
argv[0], strerror(-ret));
106+
102107
out_free2:
103108
kfree(data.buf);
104109
out_close:

0 commit comments

Comments
 (0)