diff mbox series

test-container: print errno when execvp fails

Message ID 20200311000525.918662-1-michael.hudson@canonical.com
State New
Headers show
Series test-container: print errno when execvp fails | expand

Commit Message

Michael Kerrisk \(man-pages\) via Libc-alpha March 11, 2020, 12:05 a.m. UTC
I'm debugging a situation where lots of tests using test-container fail
and it's possible knowing errno would help understand why.
---
 support/test-container.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/support/test-container.c b/support/test-container.c
index e970eb2c18..dff2ff379e 100644
--- a/support/test-container.c
+++ b/support/test-container.c
@@ -1145,7 +1145,7 @@  main (int argc, char **argv)
   execvp (new_child_exec, new_child_proc);
 
   /* Or don't run the child?  */
-  FAIL_EXIT1 ("Unable to exec %s\n", new_child_exec);
+  FAIL_EXIT1 ("Unable to exec %s: %s\n", new_child_exec, strerror (errno));
 
   /* Because gcc won't know error () never returns...  */
   exit (EXIT_UNSUPPORTED);