From maintainers-request at octave dot org Sun Jan 30 16:24:08 2005 Subject: Re: Reprise: external pager quitting kills standard error From: Daniel J Sebald To: maintainers at octave dot org Date: Sun, 30 Jan 2005 16:30:33 -0600 Daniel J Sebald wrote: > Furthermore, the external pager is a stream. And it wouldn't surprise > me that when large amounts of data are put into the stream and the > other end quits while there is still stuff to be pulled out, that the > stream might think the external pager has died. (Does "less" pull > everything out of the stream at the beginning? Or only as the cursor > is advanced?) And below is the portion of code that print's out the "warning: broken pipe" message. The "FIXME" message is a bit suspicious as it has something to do with the octave interrupt state, which is what that chunk of code I sent last time from pager.cc seems to mess with. Now, the code below is beyond my skill. Is my compilation in fact including "SIGPIPE"? I don't know. Is that chunk of code just not being run for some reason? I don't know. MAYBE_ACK...? Don't know. MAYBE_REINSTALL...? Don't know. Do I know how sig pipes work? Not really. Dan #ifdef SIGPIPE static RETSIGTYPE sigpipe_handler (int /* sig */) { MAYBE_ACK_SIGNAL (SIGPIPE); MAYBE_REINSTALL_SIGHANDLER (SIGPIPE, sigpipe_handler); if (pipe_handler_error_count++ == 0) std::cerr << "warning: broken pipe\n"; // Don't loop forever on account of this. // XXX FIXME XXX -- will setting octave_interrupt_state really help // here? if (pipe_handler_error_count > 100 && octave_interrupt_state >= 0) octave_interrupt_state++; SIGHANDLER_RETURN (0); } #endif /* defined(SIGPIPE) */