By default abduco attempts to launch dvtm if `abduco -c` is run with no
command argument. I didn't have dvtm installed, so the resulting error
message was:

        server-execvp: No such file or directory

My first thought was that abduco was implicitly relying on a program
called 'server-execvp'. Anyway, I made a simple fix to include the
command name given to execvp(3) as part of the error message.

        $ abduco -c test
        server-execvp: dvtm: No such file or directory
        $ abduco -c test badname
        server-execvp: badname: No such file or directory

>From a7075936e6f2c422a6439ac85c9139c5a0c0cbef Mon Sep 17 00:00:00 2001
From: Brandon Mulcahy <bran...@jangler.info>
Date: Sat, 8 Nov 2014 12:42:57 -0500
Subject: [PATCH] Use more descriptive execvp error message

---
 abduco.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/abduco.c b/abduco.c
index 3b3733d..63162a8 100644
--- a/abduco.c
+++ b/abduco.c
@@ -311,7 +311,8 @@ static bool create_session(const char *name, char * const argv[]) {
 				fcntl(client_pipe[1], F_SETFD, FD_CLOEXEC);
 				fcntl(server_pipe[1], F_SETFD, FD_CLOEXEC);
 				execvp(argv[0], argv);
-				snprintf(errormsg, sizeof(errormsg), "server-execvp: %s\n", strerror(errno));
+				snprintf(errormsg, sizeof(errormsg), "server-execvp: %s: %s\n",
+						 argv[0], strerror(errno));
 				write_all(client_pipe[1], errormsg, strlen(errormsg));
 				write_all(server_pipe[1], errormsg, strlen(errormsg));
 				close(client_pipe[1]);
-- 
2.1.2

Reply via email to