summaryrefslogtreecommitdiff
path: root/src/misc/skabus-dyntee-client.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-11-30 13:06:32 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-11-30 13:06:32 +0000
commit940294e0758239f337f76f3c0f096a8cd632f2ca (patch)
tree3f72411c73d60fde0d5a21d1714e792d82cd6895 /src/misc/skabus-dyntee-client.c
parent74b9e54d92a0b0937b457b2a2e4e5bc3a5eae783 (diff)
downloadskabus-940294e0758239f337f76f3c0f096a8cd632f2ca.tar.xz
Fix build; adapt to skalibs-2.10.0.0
Diffstat (limited to 'src/misc/skabus-dyntee-client.c')
-rw-r--r--src/misc/skabus-dyntee-client.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/misc/skabus-dyntee-client.c b/src/misc/skabus-dyntee-client.c
index b73980d..907c97b 100644
--- a/src/misc/skabus-dyntee-client.c
+++ b/src/misc/skabus-dyntee-client.c
@@ -1,17 +1,17 @@
/* ISC license. */
-#include <skalibs/nonposix.h>
-#include <sys/socket.h>
#include <skalibs/sgetopt.h>
#include <skalibs/strerr2.h>
#include <skalibs/djbunix.h>
#include <skalibs/webipc.h>
+#include <skalibs/exec.h>
#define USAGE "skabus-dyntee-client path prog..."
#define dieusage() strerr_dieusage(100, USAGE)
-int main (int argc, char const *const *argv, char const *const *envp)
+int main (int argc, char const *const *argv)
{
+ int fd ;
PROG = "skabus-dyntee-client" ;
{
subgetopt_t l = SUBGETOPT_ZERO ;
@@ -28,12 +28,10 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (argc < 2) dieusage() ;
}
- {
- int fd = ipc_stream_b() ;
- if (fd < 0) strerr_diefu1sys(111, "create socket") ;
- if (!ipc_connect(fd, argv[0])) strerr_diefu2sys(111, "connect to ", argv[0]) ;
- if (shutdown(fd, SHUT_WR) < 0) strerr_diefu1sys(111, "shutdown socket for writing") ;
- if (fd_move(0, fd) < 0) strerr_diefu1sys(111, "move socket fd to stdin") ;
- }
- xpathexec_run(argv[1], argv+1, envp) ;
+ fd = ipc_stream_b() ;
+ if (fd < 0) strerr_diefu1sys(111, "create socket") ;
+ if (!ipc_connect(fd, argv[0])) strerr_diefu2sys(111, "connect to ", argv[0]) ;
+ fd_shutdown(fd, 1) ;
+ if (fd_move(0, fd) < 0) strerr_diefu1sys(111, "move socket fd to stdin") ;
+ xexec(argv+1) ;
}