* terms and conditions of the copyright.
*/
-#include <slirp.h>
-#include <libslirp.h>
-
+#include "qemu/osdep.h"
+#include "slirp.h"
+#include "libslirp.h"
#include "monitor/monitor.h"
+#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#ifdef DEBUG
int slirp_debug = DBG_CALL|DBG_MISC|DBG_ERROR;
#endif
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
inline void
insque(void *a, void *b)
{
return 0;
}
-#ifndef HAVE_STRERROR
-
-/*
- * For systems with no strerror
- */
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-char *
-strerror(error)
- int error;
-{
- if (error < sys_nerr)
- return sys_errlist[error];
- else
- return "Unknown error.";
-}
-
-#endif
-
#ifdef _WIN32
pid_t pid;
DEBUG_CALL("fork_exec");
- DEBUG_ARG("so = %lx", (long)so);
- DEBUG_ARG("ex = %lx", (long)ex);
- DEBUG_ARG("do_pty = %lx", (long)do_pty);
+ DEBUG_ARG("so = %p", so);
+ DEBUG_ARG("ex = %p", ex);
+ DEBUG_ARG("do_pty = %x", do_pty);
if (do_pty == 2) {
return 0;
bind(s, (struct sockaddr *)&addr, addrlen) < 0 ||
listen(s, 1) < 0) {
error_report("Error: inet socket: %s", strerror(errno));
- closesocket(s);
+ if (s >= 0) {
+ closesocket(s);
+ }
return 0;
}