From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: MS-Windows build broken in Fmake_network_process Date: Fri, 26 Mar 2010 18:22:36 +0300 Message-ID: <83634jglab.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1269617114 15728 80.91.229.12 (26 Mar 2010 15:25:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 26 Mar 2010 15:25:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 26 16:25:10 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NvBPF-0004cO-9u for ged-emacs-devel@m.gmane.org; Fri, 26 Mar 2010 16:25:05 +0100 Original-Received: from localhost ([127.0.0.1]:35367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvBPE-0006Rb-Iy for ged-emacs-devel@m.gmane.org; Fri, 26 Mar 2010 11:25:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvBNV-0005hx-So for emacs-devel@gnu.org; Fri, 26 Mar 2010 11:23:17 -0400 Original-Received: from [140.186.70.92] (port=38031 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvBNU-0005gk-EK for emacs-devel@gnu.org; Fri, 26 Mar 2010 11:23:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvBNT-0000AQ-6E for emacs-devel@gnu.org; Fri, 26 Mar 2010 11:23:16 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:41990) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvBNS-0000AI-Uk for emacs-devel@gnu.org; Fri, 26 Mar 2010 11:23:15 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KZW00D009L4TJ00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Fri, 26 Mar 2010 18:22:37 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.176.135]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KZW00D5GAPL5J50@a-mtaout20.012.net.il>; Fri, 26 Mar 2010 18:22:34 +0300 (IDT) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122705 Archived-At: This change: revno: 99750 author: Helmut Eller committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Thu 2010-03-25 17:48:52 +0900 message: Call `select' for interrupted `connect' rather than creating new socket (Bug#5173). breaks the MS-Windows build: The compiler emits a warning, and the linker errors out: gcc -I. -c -gdwarf-2 -g3 -mtune=pentium4 -O2 -Demacs=1 -DHAVE_CONFIG_H -I../nt/inc -DHAVE_NTGUI=1 -DUSE_CRT_DLL=1 -o oo-spd/i386/process.o process.c process.c: In function `Fmake_network_process': process.c:3663: warning: passing arg 4 of `getsockopt' from incompatible pointer type oo-spd/i386/temacs1.a(process.o)(.text+0x3297): In function `Fmake_network_process': D:\gnu\bzr\emacs\trunk\src/process.c:3663: undefined reference to `getsockopt@20' The compiler warning is because the prototype on Windows is: int getsockopt(SOCKET, int, int, char*, int*); The linker error is because we would need to link against yet another library to get this function. But I don't think we should do that. I'm actually bewildered why this code: int len = sizeof xerrno; eassert (FD_ISSET (s, &fdset)); if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1) report_file_error ("getsockopt failed", Qnil); was used unconditionally when a very similar code in wait_reading_process_output is clearly marked with a comment saying not to use it except on GNU/Linux: #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. */ { int xlen = sizeof(xerrno); if (getsockopt(channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen)) xerrno = errno; } #else Would you please provide an alternative code (similar to what the #else branch does in wait_reading_process_output) that will not use getsockopt?