[OpenWrt-Devel] [PATCH ucert 04/13] usign-exec: simplify usign execv calls
Matthias Schiffer
mschiffer at universe-factory.net
Sat May 16 17:13:54 EDT 2020
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 at universe-factory.net>
---
usign-exec.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/usign-exec.c b/usign-exec.c
index 7f6106580b16..4ff2e63c5be1 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.26.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list