aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-12-12 11:45:10 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-12-12 11:45:10 +0000
commit7c446028fdf8dbd934a0450555784fed3c2c53af (patch)
tree5404171fe38c3234c02a18405b76308b59c2c299 /misc.c
parent70d7a6832df9e47a6e7ce921a9e7314a1960171a (diff)
downloadslirp-7c446028fdf8dbd934a0450555784fed3c2c53af.zip
slirp-7c446028fdf8dbd934a0450555784fed3c2c53af.tar.gz
slirp-7c446028fdf8dbd934a0450555784fed3c2c53af.tar.bz2
slirp fix for -smb command (Initial patch by Juergen Keil)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1172 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 9dafc06..0fc53d3 100644
--- a/misc.c
+++ b/misc.c
@@ -295,7 +295,7 @@ int do_pty;
/* don't want to clobber the original */
char *bptr;
char *curarg;
- int c, i;
+ int c, i, ret;
DEBUG_CALL("fork_exec");
DEBUG_ARG("so = %lx", (long)so);
@@ -347,7 +347,9 @@ int do_pty;
*/
s = socket(AF_INET, SOCK_STREAM, 0);
addr.sin_addr = loopback_addr;
- connect(s, (struct sockaddr *)&addr, addrlen);
+ do {
+ ret = connect(s, (struct sockaddr *)&addr, addrlen);
+ } while (ret < 0 && errno == EINTR);
}
#if 0
@@ -413,7 +415,9 @@ int do_pty;
* 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,