access to -smb directory does not work reliable
PATCH 1/1 access to -smb directory does not work reliable
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
misc.c 10 Dec 2004 18:12:32 -0000 renamed from misc.c 10 Oct 2004 18:00:00 -0000 1.4 +0 -0
@@ -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));