Commit 07a25b09 authored by Mike Hibler's avatar Mike Hibler
Browse files

Attempt to prevent progmode capture from hanging on program death.

I was attempting to read back any last words the program might have
uttered, but if it said nothing, we would hang. I would not have
expected this behavior from a pipe (actually, socketpair) when the
other end has gone away! But, make it non blocking before we read
to be safe.
parent 5e618d1a
......@@ -1765,6 +1765,7 @@ progmode(int isrestart)
warning("%s: program (pid=%d) died immediately, "
"status=0x%x, output:",
Devname, progpid, status);
fcntl(pipefds[0], F_SETFL, O_NONBLOCK);
cc = read(pipefds[0], buf, sizeof(buf)-1);
if (cc > 0) {
buf[cc] = '\0';
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment