summaryrefslogtreecommitdiff
path: root/src/libstddjb/child_spawn.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-02-17 22:30:53 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-02-17 22:30:53 +0000
commitfdffefb8032922ce7ffe4c00816072a8ff2148fc (patch)
treebc7313151a429c45d8bab8ad8b9dd32f4e51335f /src/libstddjb/child_spawn.c
parenta896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 (diff)
downloadskalibs-fdffefb8032922ce7ffe4c00816072a8ff2148fc.tar.xz
More types changes
New disize Add size_t to the autotypes list Delete redundant and replace-libc files dev_t/ino_t pass Big size_t pass More things missing, still not operational yet
Diffstat (limited to 'src/libstddjb/child_spawn.c')
-rw-r--r--src/libstddjb/child_spawn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstddjb/child_spawn.c b/src/libstddjb/child_spawn.c
index 78b45ac..db00bd3 100644
--- a/src/libstddjb/child_spawn.c
+++ b/src/libstddjb/child_spawn.c
@@ -49,10 +49,10 @@ pid_t child_spawn (char const *prog, char const *const *argv, char const *const
int p[n ? n : 1][2] ;
pid_t pid ;
int e ;
- unsigned int m = sizeof(NOFDVAR) ;
+ size_t m = sizeof(NOFDVAR) ;
unsigned int i = 0 ;
char modifs[m + 1 + n * UINT_FMT] ;
- byte_copy(modifs, sizeof(NOFDVAR), NOFDVAR "=") ;
+ memcpy(modifs, NOFDVAR "=", sizeof(NOFDVAR)) ;
for (; i < n ; i++) if (pipe(p[i]) < 0) { e = errno ; goto errpi ; }
for (i = 0 ; i < n ; i++)
if ((ndelay_on(p[i][i & 1]) < 0) || (coe(p[i][i & 1]) < 0))
@@ -96,7 +96,7 @@ pid_t child_spawn (char const *prog, char const *const *argv, char const *const
}
{
int haspath = !!env_get("PATH") ;
- unsigned int envlen = env_len(envp) ;
+ size_t envlen = env_len(envp) ;
char const *newenv[envlen + 2] ;
if (!env_merge(newenv, envlen+2, envp, envlen, modifs, m)) goto errsp ;
if (!haspath && (setenv("PATH", SKALIBS_DEFAULTPATH, 0) < 0))
@@ -119,10 +119,10 @@ pid_t child_spawn (char const *prog, char const *const *argv, char const *const
if (pid < 0) { e = errno ; goto errsp ; }
else if (!pid)
{
- unsigned int len = str_len(PROG) ;
+ size_t len = strlen(PROG) ;
char name[len + 9] ;
- byte_copy(name, len, PROG) ;
- byte_copy(name + len, 9, " (child)") ;
+ memcpy(name, PROG, len) ;
+ memcpy(name + len, " (child)", 9) ;
PROG = name ;
fd_close(syncpipe[0]) ;
if (n >= 2)