summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2018-07-22 13:39:10 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2018-07-22 13:39:10 +0200
commit92ba34d89ac4f5b5bbb818e1c39a3cc12a405790 (patch)
tree0f3234e5ad986089c061a9402663b8533647db82 /src/process.c
parente23727978dbb07d68f730ffa60b22d59d065850e (diff)
downloademacs-92ba34d89ac4f5b5bbb818e1c39a3cc12a405790.tar.gz
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.
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 06324641346..aafb46c3615 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);
+
+ pset_status (p, list2 (Fcar (data), Fcdr (data)));
+ return;
+ }
- report_file_errno ((p->is_server
- ? "make server process failed"
- : "make client process failed"),
- contact, xerrno);
+ report_file_errno (err, contact, xerrno);
}
inch = s;