View | Details | Raw Unified | Return to bug 245462
Collapse All | Expand All

(-)libpkg/scripts.c (-1 / +8 lines)
Lines 245-256 Link Here
245
245
246
			f = fdopen(pfd.fd, "r");
246
			f = fdopen(pfd.fd, "r");
247
			for (;;) {
247
			for (;;) {
248
				if (poll(&pfd, 1, -1) == -1) {
248
				int pres = poll(&pfd, 1, 1000);
249
				if (pres == -1) {
249
					if (errno == EINTR)
250
					if (errno == EINTR)
250
						continue;
251
						continue;
251
					else
252
					else
252
						goto cleanup;
253
						goto cleanup;
253
				}
254
				}
255
				if (pres == 0) {
256
					if (waitpid(pid, NULL, WNOHANG | WNOWAIT) > 0) {
257
						break;
258
					}
259
					continue;
260
				}
254
				if (pfd.revents & (POLLERR|POLLHUP))
261
				if (pfd.revents & (POLLERR|POLLHUP))
255
					break;
262
					break;
256
				if (getline(&line, &linecap, f) > 0)
263
				if (getline(&line, &linecap, f) > 0)

Return to bug 245462