Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: SIGPIPE (Re: ZSH history not saved anymore)

On Sep 29,  9:45am, Peter Stephenson wrote:
} > Why did TRAPPIPE() receive a SIGPIPE?
} I think we're looking at this in execcmd() or similar chunks.
} 		/* It's a builtin */
} 		if (forked)
} 		    closem(FDT_INTERNAL);
} 		lastval = execbuiltin(args, (Builtin) hn);
} 		fflush(stdout);
} 		if (save[1] == -2) {
} 		    if (ferror(stdout)) {
} 			zwarn("write error: %e", errno);
} 			clearerr(stdout);
} 		    }
} 		} else
} 		    clearerr(stdout);
} so it doesn't necessarily mean there's a signal, just that there's a
} broken pipe.

The zwarn() explains why the output appears more than once, but there
definitely are two calls to TRAPPIPE, so I think that does mean that
there was a signal 2 of the 3 times?

} Maybe the fflush() is enough to trigger setting errno
} again if it failed to write the first time?

The fflush is probably enough to trigger a second SIGPIPE if the shell
didn't exit on the first one.

Messages sorted by: Reverse Date, Date, Thread, Author