[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 07b77b8: Prefer getsockopt to getpeername on non-MS
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 07b77b8: Prefer getsockopt to getpeername on non-MS-Windows |
Date: |
Fri, 10 Jun 2016 06:12:10 +0000 (UTC) |
branch: master
commit 07b77b8ee02192a6d60c87002bb89a1eaee1aecc
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Prefer getsockopt to getpeername on non-MS-Windows
* admin/CPP-DEFINES: Remove HAVE_GETPEERNAME.
* configure.ac: Don’t check for getpeername.
* src/process.c (wait_reading_process_output) [!WINDOWSNT]:
Use getsockopt even if not GNU/Linux, as the platforms where
getsockopt used to hang are no doubt long dead.
---
admin/CPP-DEFINES | 1 -
configure.ac | 2 +-
src/process.c | 7 ++++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index d9df152..c7ec8ce 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -156,7 +156,6 @@ HAVE_GETLOADAVG
HAVE_GETOPT_H
HAVE_GETOPT_LONG_ONLY
HAVE_GETPAGESIZE
-HAVE_GETPEERNAME
HAVE_GETPT
HAVE_GETPWENT
HAVE_GETRLIMIT
diff --git a/configure.ac b/configure.ac
index a367582..069a726 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3848,7 +3848,7 @@ lrand48 random rint \
select getpagesize setlocale newlocale \
getrlimit setrlimit shutdown \
pthread_sigmask strsignal setitimer \
-sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
+sendto recvfrom getsockname getifaddrs freeifaddrs \
gai_strerror sync \
getpwent endpwent getgrent endgrent \
cfmakeraw cfsetspeed copysign __executable_start log2)
diff --git a/src/process.c b/src/process.c
index 5e06ccc..4d287d8 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5492,15 +5492,16 @@ wait_reading_process_output (intmax_t time_limit, int
nsecs, int read_kbd,
p = XPROCESS (proc);
-#ifdef GNU_LINUX
- /* getsockopt(,,SO_ERROR,,) is said to hang on some systems.
- So only use it on systems where it is known to work. */
+#ifndef WINDOWSNT
{
socklen_t xlen = sizeof (xerrno);
if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen))
xerrno = errno;
}
#else
+ /* On MS-Windows, getsockopt clears the error for the
+ entire process, which may not be the right thing; see
+ w32.c. Use getpeername instead. */
{
struct sockaddr pname;
socklen_t pnamelen = sizeof (pname);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 07b77b8: Prefer getsockopt to getpeername on non-MS-Windows,
Paul Eggert <=