diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-22 10:56:01 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-22 10:56:01 +0000 |
commit | f2206da976508c2ad81c3e0949ecd311a5a06709 (patch) | |
tree | b1d8d6eb586da520c827f198ae06dfb647110779 /src | |
parent | 61459e9930995a491dcac51019d01813efc495ce (diff) | |
download | s6-networking-f2206da976508c2ad81c3e0949ecd311a5a06709.tar.xz |
Optimize to xpathexec ; prepare for 2.3.0.2
Diffstat (limited to 'src')
-rw-r--r-- | src/conn-tools/s6-tcpclient.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver-access.c | 6 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver4-socketbinder.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver4.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver6-socketbinder.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver6.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tlsclient.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tlsserver.c | 3 | ||||
-rw-r--r-- | src/sbearssl/sbearssl_cert_readbigpem.c | 2 |
10 files changed, 11 insertions, 21 deletions
diff --git a/src/conn-tools/s6-tcpclient.c b/src/conn-tools/s6-tcpclient.c index 47be4a7..062047c 100644 --- a/src/conn-tools/s6-tcpclient.c +++ b/src/conn-tools/s6-tcpclient.c @@ -374,6 +374,5 @@ int main (int argc, char const *const *argv) if (fd_move(6, s) < 0) strerr_diefu2sys(111, "set up fd ", "6") ; if (fd_copy(7, 6) < 0) strerr_diefu2sys(111, "set up fd ", "7") ; - pathexec(argv+2) ; - strerr_dieexec(111, argv[2]) ; + xpathexec(argv+2) ; } diff --git a/src/conn-tools/s6-tcpserver-access.c b/src/conn-tools/s6-tcpserver-access.c index e16fe08..720da7e 100644 --- a/src/conn-tools/s6-tcpserver-access.c +++ b/src/conn-tools/s6-tcpserver-access.c @@ -379,12 +379,10 @@ int main (int argc, char const *const *argv, char const *const *envp) if (params.exec.len) { char *specialargv[4] = { EXECLINE_EXTBINPREFIX "execlineb", "-c", params.exec.s, 0 } ; - pathexec_r((char const *const *)specialargv, envp, env_len(envp), params.env.s, params.env.len) ; - strerr_dieexec(111, specialargv[0]) ; + xpathexec_r((char const *const *)specialargv, envp, env_len(envp), params.env.s, params.env.len) ; } - pathexec_r(argv, envp, env_len(envp), params.env.s, params.env.len) ; - strerr_dieexec(111, argv[0]) ; + xpathexec_r(argv, envp, env_len(envp), params.env.s, params.env.len) ; reject: if (verbosity >= 2) diff --git a/src/conn-tools/s6-tcpserver.c b/src/conn-tools/s6-tcpserver.c index 3866b75..1143af7 100644 --- a/src/conn-tools/s6-tcpserver.c +++ b/src/conn-tools/s6-tcpserver.c @@ -130,7 +130,6 @@ int main (int argc, char const *const *argv, char const *const *envp) newargv[m++] = "--" ; while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - pathexec_run(newargv[0], newargv, envp) ; - strerr_dieexec(111, newargv[0]) ; + xpathexec_run(newargv[0], newargv, envp) ; } } diff --git a/src/conn-tools/s6-tcpserver4-socketbinder.c b/src/conn-tools/s6-tcpserver4-socketbinder.c index cc97486..e32eb4f 100644 --- a/src/conn-tools/s6-tcpserver4-socketbinder.c +++ b/src/conn-tools/s6-tcpserver4-socketbinder.c @@ -48,6 +48,5 @@ int main (int argc, char const *const *argv, char const *const *envp) if (backlog && socket_listen(0, backlog) < 0) strerr_diefu5sys(111, "listen to ", argv[0], ":", argv[1], " ") ; - pathexec_run(argv[2], argv + 2, envp) ; - strerr_dieexec(111, argv[2]) ; + xpathexec_run(argv[2], argv + 2, envp) ; } diff --git a/src/conn-tools/s6-tcpserver4.c b/src/conn-tools/s6-tcpserver4.c index 6860871..f97d307 100644 --- a/src/conn-tools/s6-tcpserver4.c +++ b/src/conn-tools/s6-tcpserver4.c @@ -123,7 +123,6 @@ int main (int argc, char const *const *argv, char const *const *envp) newargv[m++] = "--" ; while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - pathexec_run(newargv[0], newargv, envp) ; - strerr_dieexec(111, newargv[0]) ; + xpathexec_run(newargv[0], newargv, envp) ; } } diff --git a/src/conn-tools/s6-tcpserver6-socketbinder.c b/src/conn-tools/s6-tcpserver6-socketbinder.c index 4fc3ab4..143bfe9 100644 --- a/src/conn-tools/s6-tcpserver6-socketbinder.c +++ b/src/conn-tools/s6-tcpserver6-socketbinder.c @@ -48,6 +48,5 @@ int main (int argc, char const *const *argv, char const *const *envp) if (backlog && socket_listen(0, backlog) < 0) strerr_diefu5sys(111, "listen to ", argv[0], ":", argv[1], " ") ; - pathexec_run(argv[2], argv + 2, envp) ; - strerr_dieexec(111, argv[2]) ; + xpathexec_run(argv[2], argv + 2, envp) ; } diff --git a/src/conn-tools/s6-tcpserver6.c b/src/conn-tools/s6-tcpserver6.c index 8648e8e..f96d45b 100644 --- a/src/conn-tools/s6-tcpserver6.c +++ b/src/conn-tools/s6-tcpserver6.c @@ -123,7 +123,6 @@ int main (int argc, char const *const *argv, char const *const *envp) newargv[m++] = "--" ; while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - pathexec_run(newargv[0], newargv, envp) ; - strerr_dieexec(111, newargv[0]) ; + xpathexec_run(newargv[0], newargv, envp) ; } } diff --git a/src/conn-tools/s6-tlsclient.c b/src/conn-tools/s6-tlsclient.c index 5bcc7e7..267f457 100644 --- a/src/conn-tools/s6-tlsclient.c +++ b/src/conn-tools/s6-tlsclient.c @@ -197,7 +197,6 @@ int main (int argc, char const *const *argv, char const *const *envp) newargv[m++] = "--" ; while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - pathexec_run(newargv[0], newargv, envp) ; - strerr_dieexec(111, newargv[0]) ; + xpathexec_run(newargv[0], newargv, envp) ; } } diff --git a/src/conn-tools/s6-tlsserver.c b/src/conn-tools/s6-tlsserver.c index d6c84f5..fa36226 100644 --- a/src/conn-tools/s6-tlsserver.c +++ b/src/conn-tools/s6-tlsserver.c @@ -242,7 +242,6 @@ int main (int argc, char const *const *argv, char const *const *envp) } while (*argv) newargv[m++] = *argv++ ; newargv[m++] = 0 ; - pathexec_run(newargv[0], newargv, envp) ; - strerr_dieexec(111, newargv[0]) ; + xpathexec_run(newargv[0], newargv, envp) ; } } diff --git a/src/sbearssl/sbearssl_cert_readbigpem.c b/src/sbearssl/sbearssl_cert_readbigpem.c index 9df5ebd..64ce139 100644 --- a/src/sbearssl/sbearssl_cert_readbigpem.c +++ b/src/sbearssl/sbearssl_cert_readbigpem.c @@ -25,8 +25,8 @@ int sbearssl_cert_readbigpem (char const *fn, genalloc *certs, stralloc *sa) int r ; if (fd < 0) return -1 ; r = sbearssl_pem_decode_from_buffer(&b, &pems, sa) ; - if (r) { fd_close(fd) ; return r ; } fd_close(fd) ; + if (r) return r ; p = genalloc_s(sbearssl_pemobject, &pems) ; n = genalloc_len(sbearssl_pemobject, &pems) ; for (; i < n ; i++) |