diff options
Diffstat (limited to 'src/process.c')
-rw-r--r-- | src/process.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/process.c b/src/process.c index 698a2c3ac02..c8123be28e8 100644 --- a/src/process.c +++ b/src/process.c @@ -3587,17 +3587,23 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, if (s < 0) { + const char *err = (p->is_server + ? "make server process failed" + : "make client process failed"); + /* If non-blocking got this far - and failed - assume non-blocking is not supported after all. This is probably a wrong assumption, but the normal blocking calls to open-network-stream handles this error better. */ if (p->is_non_blocking_client) - return; + { + Lisp_Object data = get_file_errno_data (err, contact, xerrno); - report_file_errno ((p->is_server - ? "make server process failed" - : "make client process failed"), - contact, xerrno); + pset_status (p, list2 (Fcar (data), Fcdr (data))); + return; + } + + report_file_errno (err, contact, xerrno); } inch = s; @@ -3905,7 +3911,7 @@ usage: (make-network-process &rest ARGS) */) CHECK_STRING (name); /* :local ADDRESS or :remote ADDRESS */ - if (!NILP (server)) + if (NILP (server)) address = Fplist_get (contact, QCremote); else address = Fplist_get (contact, QClocal); @@ -4608,16 +4614,15 @@ is nil, from any process) before the timeout expired. */) /* Can't wait for a process that is dedicated to a different thread. */ - if (!EQ (proc->thread, Qnil) && !EQ (proc->thread, Fcurrent_thread ())) + if (!NILP (proc->thread) && !EQ (proc->thread, Fcurrent_thread ())) { Lisp_Object proc_thread_name = XTHREAD (proc->thread)->name; - if (STRINGP (proc_thread_name)) - error ("Attempt to accept output from process %s locked to thread %s", - SDATA (proc->name), SDATA (proc_thread_name)); - else - error ("Attempt to accept output from process %s locked to thread %p", - SDATA (proc->name), XTHREAD (proc->thread)); + error ("Attempt to accept output from process %s locked to thread %s", + SDATA (proc->name), + STRINGP (proc_thread_name) + ? SDATA (proc_thread_name) + : SDATA (Fprin1_to_string (proc->thread, Qt))); } } else @@ -5016,7 +5021,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, struct timespec now = invalid_timespec (); eassert (wait_proc == NULL - || EQ (wait_proc->thread, Qnil) + || NILP (wait_proc->thread) || XTHREAD (wait_proc->thread) == current_thread); FD_ZERO (&Available); |