From 087a1d3f083e9df8da689b1ebc89febd20be5401 Mon Sep 17 00:00:00 2001 From: Tamas Erdei <info@erdeitamas.hu> Date: Wed, 23 Aug 2017 12:39:27 +0200 Subject: [PATCH] Add error reporting after execvp in pppd_run Print the error message of the failed execvp call to STDERR before exiting. Exit with EXIT_FAILURE. --- src/tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tunnel.c b/src/tunnel.c index e48db40..bc294a5 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -144,7 +144,8 @@ static int pppd_run(struct tunnel *tunnel) close(tunnel->ssl_socket); execvp(args[0], args); - exit(errno); + fprintf(stderr, "execvp: %s\n", strerror(errno)); + exit(EXIT_FAILURE); } // Set non-blocking -- GitLab