summaryrefslogtreecommitdiff
path: root/slirp/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/misc.c')
-rw-r--r--slirp/misc.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index d40fd629f..755dfec94 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -8,8 +8,7 @@
#define WANT_SYS_IOCTL_H
#include <slirp.h>
-u_int curtime, time_fasttimo, last_slowtimo, detach_time;
-u_int detach_wait = 600000; /* 10 minutes */
+u_int curtime, time_fasttimo, last_slowtimo;
#if 0
int x_port = -1;
@@ -214,10 +213,7 @@ strerror(error)
#ifdef _WIN32
int
-fork_exec(so, ex, do_pty)
- struct socket *so;
- char *ex;
- int do_pty;
+fork_exec(struct socket *so, const char *ex, int do_pty)
{
/* not implemented */
return 0;
@@ -225,6 +221,7 @@ fork_exec(so, ex, do_pty)
#else
+#ifndef CONFIG_QEMU
int
slirp_openpty(amaster, aslave)
int *amaster, *aslave;
@@ -289,6 +286,7 @@ slirp_openpty(amaster, aslave)
return (-1);
#endif
}
+#endif
/*
* XXX This is ugly
@@ -302,23 +300,20 @@ slirp_openpty(amaster, aslave)
* do_ptr = 2 Fork/exec using pty
*/
int
-fork_exec(so, ex, do_pty)
- struct socket *so;
- char *ex;
- int do_pty;
+fork_exec(struct socket *so, const char *ex, int do_pty)
{
int s;
struct sockaddr_in addr;
int addrlen = sizeof(addr);
int opt;
- int master;
+ int master = -1;
char *argv[256];
#if 0
char buff[256];
#endif
/* don't want to clobber the original */
char *bptr;
- char *curarg;
+ const char *curarg;
int c, i, ret;
DEBUG_CALL("fork_exec");
@@ -327,10 +322,12 @@ fork_exec(so, ex, do_pty)
DEBUG_ARG("do_pty = %lx", (long)do_pty);
if (do_pty == 2) {
+#if 0
if (slirp_openpty(&master, &s) == -1) {
lprint("Error: openpty failed: %s\n", strerror(errno));
return 0;
}
+#endif
} else {
addr.sin_family = AF_INET;
addr.sin_port = 0;
@@ -390,7 +387,7 @@ fork_exec(so, ex, do_pty)
dup2(s, 0);
dup2(s, 1);
dup2(s, 2);
- for (s = 3; s <= 255; s++)
+ for (s = getdtablesize() - 1; s >= 3; s--)
close(s);
i = 0;