Check for pipe() return code on --pipe

This commit is contained in:
Panu Matilainen 2008-05-05 07:37:50 +03:00
parent 25136233db
commit 961b6c4b2f
1 changed files with 4 additions and 3 deletions

View File

@ -580,7 +580,10 @@ int main(int argc, char *argv[])
#endif /* IAM_RPMBT || IAM_RPMK */
if (rpmcliPipeOutput) {
(void) pipe(p);
if (pipe(p) < 0) {
fprintf(stderr, _("creating a pipe for --pipe failed: %m\n"));
goto exit;
}
if (!(pipeChild = fork())) {
(void) signal(SIGPIPE, SIG_DFL);
@ -827,9 +830,7 @@ int main(int argc, char *argv[])
break;
}
#if defined(IAM_RPMBT) || defined(IAM_RPMK)
exit:
#endif /* IAM_RPMBT || IAM_RPMK */
ts = rpmtsFree(ts);