summaryrefslogtreecommitdiff
path: root/slirp/misc.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-26 19:01:16 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-26 19:01:16 +0000
commit9634d9031c140b24c7ca0d8872632207f6ce7275 (patch)
tree34ba241de1f12fcbd4e3301f081c50ff2db654da /slirp/misc.c
parent31a60e22752d3daaa248ca10930f3cf4bc5f02e8 (diff)
Use const and static as needed, disable unused code
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3452 c046a42c-6fe2-441c-8c8c-71466251a162
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 d40fd629f1..755dfec94b 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;