Check for pipe() returns in rpmfc helper output reading

This commit is contained in:
Panu Matilainen 2008-05-05 08:23:24 +03:00
parent b15e3e3ca1
commit 12bb7024fd
1 changed files with 4 additions and 2 deletions

View File

@ -102,9 +102,11 @@ static StringBuf getOutputFrom(const char * dir, ARGV_t argv,
oldhandler = signal(SIGPIPE, SIG_IGN);
toProg[0] = toProg[1] = 0;
(void) pipe(toProg);
fromProg[0] = fromProg[1] = 0;
(void) pipe(fromProg);
if (pipe(toProg) < 0 || pipe(fromProg) < 0) {
rpmlog(RPMLOG_ERR, _("Couldn't create pipe for %s: %m\n"), argv[0]);
return NULL;
}
if (!(child = fork())) {
(void) close(toProg[1]);