aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c
index eab9daa6bdd..8e4a0d22160 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2323,7 +2323,11 @@ get_lisp_to_sockaddr_size (address, familyp)
2323} 2323}
2324 2324
2325/* Convert an address object (vector or string) to an internal sockaddr. 2325/* Convert an address object (vector or string) to an internal sockaddr.
2326 Format of address has already been validated by size_lisp_to_sockaddr. */ 2326
2327 The address format has been basically validated by
2328 get_lisp_to_sockaddr_size, but this does not mean FAMILY is valid;
2329 it could have come from user data. So if FAMILY is not valid,
2330 we return after zeroing *SA. */
2327 2331
2328static void 2332static void
2329conv_lisp_to_sockaddr (family, address, sa, len) 2333conv_lisp_to_sockaddr (family, address, sa, len)
@@ -2337,7 +2341,6 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2337 register int i; 2341 register int i;
2338 2342
2339 bzero (sa, len); 2343 bzero (sa, len);
2340 sa->sa_family = family;
2341 2344
2342 if (VECTORP (address)) 2345 if (VECTORP (address))
2343 { 2346 {
@@ -2349,6 +2352,7 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2349 i = XINT (p->contents[--len]); 2352 i = XINT (p->contents[--len]);
2350 sin->sin_port = htons (i); 2353 sin->sin_port = htons (i);
2351 cp = (unsigned char *)&sin->sin_addr; 2354 cp = (unsigned char *)&sin->sin_addr;
2355 sa->sa_family = family;
2352 } 2356 }
2353#ifdef AF_INET6 2357#ifdef AF_INET6
2354 else if (family == AF_INET6) 2358 else if (family == AF_INET6)
@@ -2364,9 +2368,10 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2364 int j = XFASTINT (p->contents[i]) & 0xffff; 2368 int j = XFASTINT (p->contents[i]) & 0xffff;
2365 ip6[i] = ntohs (j); 2369 ip6[i] = ntohs (j);
2366 } 2370 }
2367 return; 2371 sa->sa_family = family;
2368 } 2372 }
2369#endif 2373#endif
2374 return;
2370 } 2375 }
2371 else if (STRINGP (address)) 2376 else if (STRINGP (address))
2372 { 2377 {
@@ -2377,6 +2382,7 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2377 cp = SDATA (address); 2382 cp = SDATA (address);
2378 for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++) 2383 for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++)
2379 sockun->sun_path[i] = *cp++; 2384 sockun->sun_path[i] = *cp++;
2385 sa->sa_family = family;
2380 } 2386 }
2381#endif 2387#endif
2382 return; 2388 return;
@@ -6229,6 +6235,8 @@ text to PROCESS after you call this function. */)
6229 emacs_close (XINT (XPROCESS (proc)->outfd)); 6235 emacs_close (XINT (XPROCESS (proc)->outfd));
6230#endif /* not HAVE_SHUTDOWN */ 6236#endif /* not HAVE_SHUTDOWN */
6231 new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0); 6237 new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0);
6238 if (new_outfd < 0)
6239 abort ();
6232 old_outfd = XINT (XPROCESS (proc)->outfd); 6240 old_outfd = XINT (XPROCESS (proc)->outfd);
6233 6241
6234 if (!proc_encode_coding_system[new_outfd]) 6242 if (!proc_encode_coding_system[new_outfd])