xpipe: introduce (saves ~170 bytes)

udhcp/signalpipe.c: use pipe instead of socketpair.
This commit is contained in:
Denis Vlasenko
2007-05-26 16:44:20 +00:00
parent 6239b1f50a
commit 5a6aeddfa7
9 changed files with 35 additions and 36 deletions

View File

@@ -420,7 +420,7 @@ int runsv_main(int argc, char **argv)
if (!argv[1] || argv[2]) usage();
dir = argv[1];
if (pipe(selfpipe) == -1) fatal_cannot("create selfpipe");
xpipe(selfpipe);
coe(selfpipe[0]);
coe(selfpipe[1]);
ndelay_on(selfpipe[0]);
@@ -456,8 +456,7 @@ int runsv_main(int argc, char **argv)
taia_now(&svd[1].start);
if (stat("log/down", &s) != -1)
svd[1].want = W_DOWN;
if (pipe(logpipe) == -1)
fatal_cannot("create log pipe");
xpipe(logpipe);
coe(logpipe[0]);
coe(logpipe[1]);
}

View File

@@ -184,7 +184,7 @@ static int setup_log(void)
warnx("log must have at least seven characters");
return 0;
}
if (pipe(logpipe) == -1) {
if (pipe(logpipe)) {
warnx("cannot create pipe for log");
return -1;
}