From a9be4fb17df233fb9d23d3dae7aa6ce19fd7f38c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 16 May 2020 14:52:35 +0200 Subject: [PATCH] usign-exec: simplify usign execv calls When the executable to exec is passed as an absolute path, execv() and execvp() are equivalent, so there it no need to make the code hard to read with #ifdefs. Signed-off-by: Matthias Schiffer --- usign-exec.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/usign-exec.c b/usign-exec.c index 7f61065..4ff2e63 100644 --- a/usign-exec.c +++ b/usign-exec.c @@ -72,13 +72,7 @@ int usign_s(const char *msgfile, const char *seckeyfile, const char *sigfile, bo return -1; case 0: - if ( -#ifdef UCERT_HOST_BUILD - execvp(usign_argv[0], (char *const *)usign_argv) -#else - execv(usign_argv[0], (char *const *)usign_argv) -#endif - ) + if (execvp(usign_argv[0], (char *const *)usign_argv)) return -1; break; @@ -141,13 +135,7 @@ static int usign_f(char *fingerprint, const char *pubkeyfile, const char *seckey close(fds[0]); close(fds[1]); - if ( -#ifdef UCERT_HOST_BUILD - execvp(usign_argv[0], (char *const *)usign_argv) -#else - execv(usign_argv[0], (char *const *)usign_argv) -#endif - ) + if (execvp(usign_argv[0], (char *const *)usign_argv)) return -1; break; @@ -247,13 +235,7 @@ int usign_v(const char *msgfile, const char *pubkeyfile, return -1; case 0: - if ( -#ifdef UCERT_HOST_BUILD - execvp(usign_argv[0], (char *const *)usign_argv) -#else - execv(usign_argv[0], (char *const *)usign_argv) -#endif - ) + if (execvp(usign_argv[0], (char *const *)usign_argv)) return -1; break; -- 2.25.1