X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fprocess-unix.c;h=424246f6f15bfb79cc7f177d68356e08e2a3ee5a;hp=d50028ef325371d91a29483a83c4ee49f698af85;hb=ee38d21b330f5001b47a577cefb5ba7b82a3b7d3;hpb=40402600969429d5253e62c6314a3eebbb21f027 diff --git a/src/process-unix.c b/src/process-unix.c index d50028e..424246f 100644 --- a/src/process-unix.c +++ b/src/process-unix.c @@ -220,6 +220,7 @@ allocate_pty (void) allocate_pty() tries all the different known easy ways of opening a pty. In case of failure, we resort to the old BSD-style pty grovelling code in allocate_pty_the_old_fashioned_way(). */ +#ifndef FORCE_ALLOCATE_PTY_THE_OLD_FASHIONED_WAY int master_fd = -1; const char *slave_name = NULL; const char *clone = NULL; @@ -342,6 +343,7 @@ allocate_pty (void) lose: if (master_fd >= 0) close (master_fd); +#endif /* ndef FORCE_ALLOCATE_PTY_THE_OLD_FASHIONED_WAY */ return allocate_pty_the_old_fashioned_way (); } @@ -890,6 +892,7 @@ unix_create_process (Lisp_Process *p, #endif set_descriptor_non_blocking (inchannel); + set_descriptor_non_blocking (outchannel); /* Record this as an active process, with its channels. As a result, child_setup will close Emacs's side of the pipes. */ @@ -912,6 +915,10 @@ unix_create_process (Lisp_Process *p, int xforkin = forkin; int xforkout = forkout; + /* Checking for quit in the child is bad because that will + cause I/O, and that, in turn, can confuse the X connection. */ + begin_dont_check_for_quit(); + /* Disconnect the current controlling terminal, pursuant to making the pty be the controlling terminal of the process. Also put us in our own process group. */ @@ -1288,11 +1295,11 @@ unix_send_process (Lisp_Object proc, struct lstream* lstream) while (1) { - ssize_t writeret; + Lstream_data_count writeret; chunklen = Lstream_read (lstream, chunkbuf, 512); if (chunklen <= 0) - break; /* perhaps should abort() if < 0? + break; /* perhaps should ABORT() if < 0? This should never happen. */ old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); @@ -1329,6 +1336,9 @@ unix_send_process (Lisp_Object proc, struct lstream* lstream) /* #### There is controversy over whether this might cause fd leakage */ /* my tests say no. -slb */ XLSTREAM (p->pipe_outstream)->flags &= ~LSTREAM_FL_IS_OPEN; +#ifdef FILE_CODING + XLSTREAM (p->coding_outstream)->flags &= ~LSTREAM_FL_IS_OPEN; +#endif p->status_symbol = Qexit; p->exit_code = 256; /* #### SIGPIPE ??? */ p->core_dumped = 0; @@ -1543,9 +1553,9 @@ unix_kill_child_process (Lisp_Object proc, int signo, if (EMACS_KILLPG (pgid, signo) == -1) { /* It's not an error if our victim is already dead. - And we can't rely on the result of killing a zombie, since - XPG 4.2 requires that killing a zombie fail with ESRCH, - while FIPS 151-2 requires that it succeeds! */ + And we can't rely on the result of killing a zombie, since + XPG 4.2 requires that killing a zombie fail with ESRCH, + while FIPS 151-2 requires that it succeeds! */ #ifdef ESRCH if (errno != ESRCH) #endif @@ -1587,7 +1597,11 @@ unix_canonicalize_host_name (Lisp_Object host) xzero (hints); hints.ai_flags = AI_CANONNAME; +#ifdef IPV6_CANONICALIZE hints.ai_family = AF_UNSPEC; +#else + hints.ai_family = PF_INET; +#endif hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; LISP_STRING_TO_EXTERNAL (host, ext_host, Qnative); @@ -1764,6 +1778,7 @@ unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object servic failed_connect = 1; close (s); + s = -1; speed_up_interrupts (); @@ -1976,7 +1991,7 @@ unix_open_multicast_group (Lisp_Object name, Lisp_Object dest, memset (&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_port = theport; - sa.sin_addr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); + sa.sin_addr.s_addr = inet_addr ((char *) XSTRING_DATA (dest)); /* Socket configuration for reading ------------------------ */ @@ -1996,7 +2011,7 @@ unix_open_multicast_group (Lisp_Object name, Lisp_Object dest, } /* join multicast group */ - imr.imr_multiaddr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); + imr.imr_multiaddr.s_addr = inet_addr ((char *) XSTRING_DATA (dest)); imr.imr_interface.s_addr = htonl (INADDR_ANY); if (setsockopt (rs, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof (struct ip_mreq)) < 0)