summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-11-30 12:28:04 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-11-30 12:28:04 +0000
commit438ec28cb8b88f392ca7b0c13447bd021810a564 (patch)
tree20fb94e28b7b2e71dd1a13089af05d3f21ab8fb7 /src
parenta59bebeba589dba1a0246925b47688b722cfe68c (diff)
downloads6-portable-utils-438ec28cb8b88f392ca7b0c13447bd021810a564.tar.xz
Prepare for 2.2.3.1, adapt to skalibs-2.10.0.0
Diffstat (limited to 'src')
-rw-r--r--src/skaembutils/s6-env.c6
-rw-r--r--src/skaembutils/s6-nice.c7
-rw-r--r--src/skaembutils/s6-sleep.c6
-rw-r--r--src/skaembutils/s6-touch.c2
-rw-r--r--src/skaembutils/seekablepipe.c14
5 files changed, 20 insertions, 15 deletions
diff --git a/src/skaembutils/s6-env.c b/src/skaembutils/s6-env.c
index ce91b94..6c039ba 100644
--- a/src/skaembutils/s6-env.c
+++ b/src/skaembutils/s6-env.c
@@ -2,10 +2,12 @@
#include <string.h>
#include <errno.h>
+
#include <skalibs/sgetopt.h>
#include <skalibs/strerr2.h>
#include <skalibs/env.h>
-#include <skalibs/djbunix.h>
+#include <skalibs/exec.h>
+
#include <s6-portable-utils/config.h>
#define USAGE "s6-env [ -i ] [ name=value... ] prog..."
@@ -37,5 +39,5 @@ int main (int argc, char const *const *argv, char const *const *envp)
strerr_diefu1sys(111, "stralloc_cats") ;
}
if (!argc) argv = arg_zero ;
- xpathexec_r(argv, envp, env_len(envp), modifs.s, modifs.len) ;
+ xmexec_em(argv, envp, modifs.s, modifs.len) ;
}
diff --git a/src/skaembutils/s6-nice.c b/src/skaembutils/s6-nice.c
index 3347d54..256f5e2 100644
--- a/src/skaembutils/s6-nice.c
+++ b/src/skaembutils/s6-nice.c
@@ -2,14 +2,15 @@
#include <unistd.h>
#include <errno.h>
+
#include <skalibs/sgetopt.h>
#include <skalibs/types.h>
#include <skalibs/strerr2.h>
-#include <skalibs/djbunix.h>
+#include <skalibs/exec.h>
#define USAGE "s6-nice [ -I | -i ] [ -n value ] prog..."
-int main (int argc, char const *const *argv, char const *const *envp)
+int main (int argc, char const *const *argv)
{
int incr = 10 ;
int strict = 0 ;
@@ -40,5 +41,5 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (strict) strerr_diefu2sys(111, "nice to ", fmt) ;
else strerr_warnwu2sys("nice to ", fmt) ;
}
- xpathexec_run(argv[0], argv, envp) ;
+ xexec(argv) ;
}
diff --git a/src/skaembutils/s6-sleep.c b/src/skaembutils/s6-sleep.c
index 27da2b2..83d8c3d 100644
--- a/src/skaembutils/s6-sleep.c
+++ b/src/skaembutils/s6-sleep.c
@@ -4,12 +4,12 @@
#include <skalibs/strerr2.h>
#include <skalibs/types.h>
#include <skalibs/tai.h>
-#include <skalibs/djbunix.h>
#include <skalibs/iopause.h>
+#include <skalibs/exec.h>
#define USAGE "s6-sleep [ -m ] duration prog..."
-int main (int argc, char const *const *argv, char const *const *envp)
+int main (int argc, char const *const *argv)
{
unsigned int n ;
int milli = 0 ;
@@ -40,5 +40,5 @@ int main (int argc, char const *const *argv, char const *const *envp)
deepsleepuntil_g(&deadline) ;
}
- xpathexec0_run(argv+1, envp) ;
+ xexec0(argv+1) ;
}
diff --git a/src/skaembutils/s6-touch.c b/src/skaembutils/s6-touch.c
index 5b90987..6aefc43 100644
--- a/src/skaembutils/s6-touch.c
+++ b/src/skaembutils/s6-touch.c
@@ -1,7 +1,7 @@
/* ISC license. */
+#include <skalibs/posixplz.h>
#include <skalibs/strerr2.h>
-#include <skalibs/djbunix.h>
#define USAGE "s6-touch file ..."
diff --git a/src/skaembutils/seekablepipe.c b/src/skaembutils/seekablepipe.c
index 419be78..c2f5f48 100644
--- a/src/skaembutils/seekablepipe.c
+++ b/src/skaembutils/seekablepipe.c
@@ -1,15 +1,18 @@
/* ISC license. */
#include <unistd.h>
+
+#include <skalibs/posixplz.h>
#include <skalibs/strerr2.h>
#include <skalibs/iobuffer.h>
#include <skalibs/djbunix.h>
+#include <skalibs/exec.h>
#define USAGE "seekablepipe tempfile prog..."
#define N 8192
-int main (int argc, char const *const *argv, char const *const *envp)
+int main (int argc, char const *const *argv)
{
iobuffer b ;
int fdr, fdw ;
@@ -22,8 +25,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
fdr = open_readb(argv[1]) ;
if (fdr < 0)
strerr_diefu3sys(111, "open ", argv[1], " for reading") ;
- if (unlink(argv[1]) < 0)
- strerr_diefu2sys(111, "unlink ", argv[1]) ;
+ unlink_void(argv[1]) ;
if (ndelay_off(fdw) < 0)
strerr_diefu1sys(111, "set fdw blocking") ;
if (!iobuffer_init(&b, 0, fdw))
@@ -33,8 +35,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
strerr_diefu2sys(111, "write to ", argv[1]) ;
if (r < 0) strerr_diefu1sys(111, "read from stdin") ;
iobuffer_finish(&b) ;
- fd_close(fdw) ;
+ close(fdw) ;
if (fd_move(0, fdr) < 0)
- strerr_diefu1sys(111, "move fdr to stdin") ;
- xpathexec_run(argv[2], argv+2, envp) ;
+ strerr_diefu1sys(111, "move temporary file descriptor") ;
+ xexec(argv+2) ;
}