From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CcpZ5-0002sq-Cu for qemu-devel@nongnu.org; Fri, 10 Dec 2004 13:32:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CcpZ4-0002rw-8C for qemu-devel@nongnu.org; Fri, 10 Dec 2004 13:32:26 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CcpZ4-0002re-3E for qemu-devel@nongnu.org; Fri, 10 Dec 2004 13:32:26 -0500 Received: from [192.76.135.70] (helo=kurt.tools.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CcpOH-0004gP-U8 for qemu-devel@nongnu.org; Fri, 10 Dec 2004 13:21:21 -0500 Received: from imap.tools.intra (imap3.tools.intra [172.20.0.8]) by kurt.tools.de (8.12.11/8.12.11) with ESMTP id iBAIKWdX023095 for ; Fri, 10 Dec 2004 19:20:34 +0100 (MET) Received: from tiger2.tools.intra (tiger2.tools.intra [172.20.0.11]) by imap.tools.intra (8.13.1+Sun/8.13.1) with SMTP id iBAIKWUS026631 for ; Fri, 10 Dec 2004 19:20:32 +0100 (MET) Message-Id: <200412101820.iBAIKWUS026631@imap.tools.intra> Date: Fri, 10 Dec 2004 19:20:32 +0100 (CET) From: Juergen Keil MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: Tmb32ofLx7WyaKwy29h/Cw== Subject: [Qemu-devel] [PATCH] access to -smb directory does not work reliable Reply-To: Juergen Keil , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org A windows guest OS is sometimes unable to mount a "-smb directory", when qemu runs on a Solaris host. Problem is the accept() call in qemu that waits for a connect() from the forked subprocess (the future smbd subprocess). The accept() call is interrupted by a SIGALRM signal and returns with return value -1 and errno == EINTR. qemu does not restart the accept() under these conditions; the -smb directory cannot be mounted by the Windows guest OS. Fix: Index: slirp/misc.c =================================================================== RCS file: /cvsroot/qemu/qemu/slirp/misc.c,v retrieving revision 1.4 diff -u -B -r1.4 misc.c --- slirp/misc.c 10 Oct 2004 18:00:00 -0000 1.4 +++ slirp/misc.c 10 Dec 2004 18:12:32 -0000 @@ -436,7 +440,9 @@ * The only reason this will block forever is if socket() * of connect() fail in the child process */ - so->s = accept(s, (struct sockaddr *)&addr, &addrlen); + do + so->s = accept(s, (struct sockaddr *)&addr, &addrlen); + while (so->s < 0 && errno == EINTR); closesocket(s); opt = 1; setsockopt(so->s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int));