aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen2018-07-22 13:39:10 +0200
committerNoam Postavsky2018-08-08 19:30:50 -0400
commit18588bce36617179cc7c8af74a6197c8e16819ea (patch)
tree68b05b7913d46d76bccdf9c19f8f42d6f5d20024 /src/process.c
parent5afbf62674e741b06c01216fe37a5439e9d42307 (diff)
downloademacs-18588bce36617179cc7c8af74a6197c8e16819ea.tar.gz
emacs-18588bce36617179cc7c8af74a6197c8e16819ea.zip
Make async :family 'local failures fail correctly again
* src/fileio.c (get_file_errno_data): Refactor out into its own function so that we can reuse the error handling from an async context (bug#31901). * src/process.c (connect_network_socket): When an async :family 'local client fails (with a file error, for instance), mark the process as failed. (cherry picked from commit 92ba34d89ac4f5b5bbb818e1c39a3cc12a405790)
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c
index 8629f834e79..676f38446e4 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3578,17 +3578,23 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
3578 3578
3579 if (s < 0) 3579 if (s < 0)
3580 { 3580 {
3581 const char *err = (p->is_server
3582 ? "make server process failed"
3583 : "make client process failed");
3584
3581 /* If non-blocking got this far - and failed - assume non-blocking is 3585 /* If non-blocking got this far - and failed - assume non-blocking is
3582 not supported after all. This is probably a wrong assumption, but 3586 not supported after all. This is probably a wrong assumption, but
3583 the normal blocking calls to open-network-stream handles this error 3587 the normal blocking calls to open-network-stream handles this error
3584 better. */ 3588 better. */
3585 if (p->is_non_blocking_client) 3589 if (p->is_non_blocking_client)
3586 return; 3590 {
3591 Lisp_Object data = get_file_errno_data (err, contact, xerrno);
3592
3593 pset_status (p, list2 (Fcar (data), Fcdr (data)));
3594 return;
3595 }
3587 3596
3588 report_file_errno ((p->is_server 3597 report_file_errno (err, contact, xerrno);
3589 ? "make server process failed"
3590 : "make client process failed"),
3591 contact, xerrno);
3592 } 3598 }
3593 3599
3594 inch = s; 3600 inch = s;