From: Matthias Schiffer Date: Sat, 16 May 2020 12:52:35 +0000 (+0200) Subject: usign-exec: simplify usign execv calls X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a9be4fb17df233fb9d23d3dae7aa6ce19fd7f38c;p=oweals%2Fucert.git 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 --- 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;