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, | |||
| 3587 | 3587 | ||
| 3588 | if (s < 0) | 3588 | if (s < 0) |
| 3589 | { | 3589 | { |
| 3590 | const char *err = (p->is_server | ||
| 3591 | ? "make server process failed" | ||
| 3592 | : "make client process failed"); | ||
| 3593 | |||
| 3590 | /* If non-blocking got this far - and failed - assume non-blocking is | 3594 | /* If non-blocking got this far - and failed - assume non-blocking is |
| 3591 | not supported after all. This is probably a wrong assumption, but | 3595 | not supported after all. This is probably a wrong assumption, but |
| 3592 | the normal blocking calls to open-network-stream handles this error | 3596 | the normal blocking calls to open-network-stream handles this error |
| 3593 | better. */ | 3597 | better. */ |
| 3594 | if (p->is_non_blocking_client) | 3598 | if (p->is_non_blocking_client) |
| 3595 | return; | 3599 | { |
| 3600 | Lisp_Object data = get_file_errno_data (err, contact, xerrno); | ||
| 3596 | 3601 | ||
| 3597 | report_file_errno ((p->is_server | 3602 | pset_status (p, list2 (Fcar (data), Fcdr (data))); |
| 3598 | ? "make server process failed" | 3603 | return; |
| 3599 | : "make client process failed"), | 3604 | } |
| 3600 | contact, xerrno); | 3605 | |
| 3606 | report_file_errno (err, contact, xerrno); | ||
| 3601 | } | 3607 | } |
| 3602 | 3608 | ||
| 3603 | inch = s; | 3609 | inch = s; |
| @@ -3905,7 +3911,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3905 | CHECK_STRING (name); | 3911 | CHECK_STRING (name); |
| 3906 | 3912 | ||
| 3907 | /* :local ADDRESS or :remote ADDRESS */ | 3913 | /* :local ADDRESS or :remote ADDRESS */ |
| 3908 | if (!NILP (server)) | 3914 | if (NILP (server)) |
| 3909 | address = Fplist_get (contact, QCremote); | 3915 | address = Fplist_get (contact, QCremote); |
| 3910 | else | 3916 | else |
| 3911 | address = Fplist_get (contact, QClocal); | 3917 | address = Fplist_get (contact, QClocal); |
| @@ -4608,16 +4614,15 @@ is nil, from any process) before the timeout expired. */) | |||
| 4608 | 4614 | ||
| 4609 | /* Can't wait for a process that is dedicated to a different | 4615 | /* Can't wait for a process that is dedicated to a different |
| 4610 | thread. */ | 4616 | thread. */ |
| 4611 | if (!EQ (proc->thread, Qnil) && !EQ (proc->thread, Fcurrent_thread ())) | 4617 | if (!NILP (proc->thread) && !EQ (proc->thread, Fcurrent_thread ())) |
| 4612 | { | 4618 | { |
| 4613 | Lisp_Object proc_thread_name = XTHREAD (proc->thread)->name; | 4619 | Lisp_Object proc_thread_name = XTHREAD (proc->thread)->name; |
| 4614 | 4620 | ||
| 4615 | if (STRINGP (proc_thread_name)) | 4621 | error ("Attempt to accept output from process %s locked to thread %s", |
| 4616 | error ("Attempt to accept output from process %s locked to thread %s", | 4622 | SDATA (proc->name), |
| 4617 | SDATA (proc->name), SDATA (proc_thread_name)); | 4623 | STRINGP (proc_thread_name) |
| 4618 | else | 4624 | ? SDATA (proc_thread_name) |
| 4619 | error ("Attempt to accept output from process %s locked to thread %p", | 4625 | : SDATA (Fprin1_to_string (proc->thread, Qt))); |
| 4620 | SDATA (proc->name), XTHREAD (proc->thread)); | ||
| 4621 | } | 4626 | } |
| 4622 | } | 4627 | } |
| 4623 | else | 4628 | else |
| @@ -5016,7 +5021,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5016 | struct timespec now = invalid_timespec (); | 5021 | struct timespec now = invalid_timespec (); |
| 5017 | 5022 | ||
| 5018 | eassert (wait_proc == NULL | 5023 | eassert (wait_proc == NULL |
| 5019 | || EQ (wait_proc->thread, Qnil) | 5024 | || NILP (wait_proc->thread) |
| 5020 | || XTHREAD (wait_proc->thread) == current_thread); | 5025 | || XTHREAD (wait_proc->thread) == current_thread); |
| 5021 | 5026 | ||
| 5022 | FD_ZERO (&Available); | 5027 | FD_ZERO (&Available); |