From ffc056e94a21b75774b1e7889439022fd74cb9a1 Mon Sep 17 00:00:00 2001 From: Frank Benkstein Date: Fri, 16 Jan 2009 23:28:14 +0100 Subject: [PATCH] src/process.{c,h}: use different error code for ENOENT --- src/process.c | 4 +++- src/process.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/process.c b/src/process.c index 525ea33..78fb012 100644 --- a/src/process.c +++ b/src/process.c @@ -252,7 +252,9 @@ bool create_child(struct child_process *child, GError **error) if (read(status_pipe[0], &child_errno, sizeof child_errno) == sizeof child_errno) { g_set_error(error, VLOCK_PROCESS_ERROR, - VLOCK_PROCESS_ERROR_FAILED, + child_errno == ENOENT ? + VLOCK_PROCESS_ERROR_NOT_FOUND : + VLOCK_PROCESS_ERROR_FAILED, "child process could not exec: %s", g_strerror(child_errno)); goto child_failed; diff --git a/src/process.h b/src/process.h index 2a42035..a62a4a9 100644 --- a/src/process.h +++ b/src/process.h @@ -19,10 +19,11 @@ /* Errors */ #define VLOCK_PROCESS_ERROR vlock_process_error_quark() -GQuark vlock_plugin_error_quark(void); +GQuark vlock_process_error_quark(void); enum { VLOCK_PROCESS_ERROR_FAILED, + VLOCK_PROCESS_ERROR_NOT_FOUND, }; /* Wait for the given amount of time for the death of the given child process. -- 2.11.4.GIT