On Sat, Dec 9, 2017 at 7:49 PM, Johann 'Myrkraverk' Oskarsson
<johann(a)myrkraverk.com> wrote:
Ok, so I "worked around this problem" by setting the read
end of the
pipe to nonblocking mode before calling connect_to_file_descriptor().
This seems to work fine for me. The pre-patched version is just one line,
so I paste it here in its entirety.
static void
unix_init_process_io_handles (Lisp_Process *p, void* in, void* out, int flags)
{
UNIX_DATA(p)->infd = (int)in;
/* In the event where the input file descriptor is a pipe, XEmacs as of
* 21.4.24 will hang on the read() system call when the pipe doesn't
* have enough to fill the incoming buffer.
*
* This will likely affect other kinds of blocking file descriptors also,
* so we unconditionally set the input fd to non-blocking mode.
*/
{
int f = fcntl( UNIX_DATA(p)->infd, F_SETFL, O_NONBLOCK );
if ( f == -1 ) {
perror( "Setting pipe to nonblocking mode" );
}
}
}
Enjoy,
--
Johann
I'm not from the internet, I just work there.