usign-exec: simplify usign execv calls
authorMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 16 May 2020 12:52:35 +0000 (14:52 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 16 May 2020 16:26:19 +0000 (18:26 +0200)
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 <mschiffer@universe-factory.net>
usign-exec.c

index 7f6106580b166ca110f0f0e10bce0ff54a7f9cd6..4ff2e63c5be166788534efc04bcb62a7c57fdbec 100644 (file)
@@ -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;