- create /usr/lib/rpm directory and move rpmrc et al there
2.5.3 -> 2.5.4:
+ - eliminate redundant close in provide/require processing.
- solaris portability patch resurrection (Steve Sanberg).
- add %license/%readme virtual file attributes
- align "Build Host:" with other fields
int failNonZero)
{
int progPID;
- int progDead;
int toProg[2];
int fromProg[2];
int status;
readBuff = newStringBuf();
- progDead = 0;
do {
- if (waitpid(progPID, &status, WNOHANG)) {
- progDead = 1;
- }
-
/* Write some stuff to the process if possible */
if (writeBytesLeft) {
if ((bytesWritten =
}
writeBytesLeft -= bytesWritten;
writePtr += bytesWritten;
- } else {
+ } else if (toProg[1] >= 0) {
close(toProg[1]);
+ toProg[1] = -1;
}
/* Read any data from prog */
- bytes = read(fromProg[0], buf, sizeof(buf)-1);
- while (bytes > 0) {
+ while ((bytes = read(fromProg[0], buf, sizeof(buf)-1)) > 0) {
buf[bytes] = '\0';
appendStringBuf(readBuff, buf);
- bytes = read(fromProg[0], buf, sizeof(buf)-1);
}
/* terminate when prog dies */
- } while (!progDead);
+ } while (!waitpid(progPID, &status, WNOHANG));
- close(toProg[1]);
+ if (toProg[1] >= 0)
+ close(toProg[1]);
close(fromProg[0]);
signal(SIGPIPE, oldhandler);