|
From: | Jan Djärv |
Subject: | Re: emacsclient horribly broken |
Date: | Thu, 02 Nov 2006 10:20:23 +0100 |
User-agent: | Thunderbird 1.5.0.7 (X11/20060913) |
Tim Van Holder skrev:
3) If the O_NONBLOCK flag actually gets set on the socket, emacslientno longer works - emacs gets the request, opens the file, then immediatelycloses it again (presumably because the client is gone). This does not happen when the O_NONBLOCK/O_NDELAY flag is not set on the socket(the FIONBIO ioctl seems to be a no-op in this regard). Removing all thefcntls and ioctls, things work normally - so is the non-blocking thing actually needed?
I've reviewed emacsclient.c and can see no need for any nonblocking behaviour. In fact, it is the wrong thing to do because:
/* Now, wait for an answer and print any messages. */ while ((rl = recv (s, string, BUFSIZ, 0)) > 0)will do the wrong thing both for FIONBIO and O_NONBLOCK. recv will return -1 or 0 if no data is available, and then emacsclient exits. Clearly not the behaviour we want. I suggest just removing all the nonblocking code. We don't use it for local sockets so we should not use it for TCP sockets either.
Jan D.
[Prev in Thread] | Current Thread | [Next in Thread] |