summary refs log tree commit diff stats
path: root/slirp/misc.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-04-02 09:46:45 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-02 09:46:45 -0500
commitcefc898806e0346eef87d15ddaac9475b57b7d84 (patch)
treece4a6312d22ba96fe33fd4c5f1f2306807a07422 /slirp/misc.c
parentaba8e41e8666e4c0287cef1f6298985d4e03211d (diff)
parent86073017e384b65a4b568da25e5873fd2e5e4db5 (diff)
downloadfocaccia-qemu-cefc898806e0346eef87d15ddaac9475b57b7d84.tar.gz
focaccia-qemu-cefc898806e0346eef87d15ddaac9475b57b7d84.zip
Merge remote-tracking branch 'kiszka/queues/slirp' into staging
* kiszka/queues/slirp:
  slirp: Signal free input buffer space to io-thread
  w32/slirp: Undefine error constants before their redefinition
  slirp: use socket_set_nonblock
  slirp: clean up conflicts with system headers
Diffstat (limited to 'slirp/misc.c')
-rw-r--r--slirp/misc.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index 0308a62fac..0bee864337 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -215,7 +215,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty)
                 setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int));
                 opt = 1;
                 setsockopt(so->s, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(int));
-		fd_nonblock(so->s);
+		socket_set_nonblock(so->s);
 
 		/* Append the telnet options now */
                 if (so->so_m != NULL && do_pty == 1)  {
@@ -267,50 +267,6 @@ u_sleep(int usec)
 	select(0, &fdset, &fdset, &fdset, &t);
 }
 
-/*
- * Set fd blocking and non-blocking
- */
-
-void
-fd_nonblock(int fd)
-{
-#ifdef FIONBIO
-#ifdef _WIN32
-        unsigned long opt = 1;
-#else
-        int opt = 1;
-#endif
-
-	ioctlsocket(fd, FIONBIO, &opt);
-#else
-	int opt;
-
-	opt = fcntl(fd, F_GETFL, 0);
-	opt |= O_NONBLOCK;
-	fcntl(fd, F_SETFL, opt);
-#endif
-}
-
-void
-fd_block(int fd)
-{
-#ifdef FIONBIO
-#ifdef _WIN32
-        unsigned long opt = 0;
-#else
-	int opt = 0;
-#endif
-
-	ioctlsocket(fd, FIONBIO, &opt);
-#else
-	int opt;
-
-	opt = fcntl(fd, F_GETFL, 0);
-	opt &= ~O_NONBLOCK;
-	fcntl(fd, F_SETFL, opt);
-#endif
-}
-
 void slirp_connection_info(Slirp *slirp, Monitor *mon)
 {
     const char * const tcpstates[] = {