diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index d9df152bff5..c7ec8ce6fed 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 a367582f2ab..069a7260e88 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 5e06ccccac8..4d287d8cc51 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);