aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/main.c b/main.c
index 3010c28..af4f395 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.254 2007/05/23 12:34:20 inu Exp $ */
+/* $Id: main.c,v 1.255 2007/05/23 15:06:05 inu Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -24,6 +24,12 @@ extern int do_getch();
#endif /* defined(USE_GPM) || defined(USE_SYSMOUSE) */
#endif
+#ifdef __MINGW32_VERSION
+#include <winsock.h>
+
+WSADATA WSAData;
+#endif
+
#define DSTR_LEN 256
Hist *LoadHist;
@@ -64,7 +70,11 @@ static char *MarkString = NULL;
static char *SearchString = NULL;
int (*searchRoutine) (Buffer *, char *);
+#ifndef __MINGW32_VERSION
JMP_BUF IntReturn;
+#else
+_JBTYPE IntReturn[_JBLEN];
+#endif /* __MINGW32_VERSION */
static void delBuffer(Buffer *buf);
static void cmd_loadfile(char *path);
@@ -753,6 +763,23 @@ main(int argc, char **argv, char **envp)
sock_init();
#endif
+#ifdef __MINGW32_VERSION
+ {
+ int err;
+ WORD wVerReq;
+
+ wVerReq = MAKEWORD(1, 1);
+
+ err = WSAStartup(wVerReq, &WSAData);
+ if (err != 0)
+ {
+ fprintf(stderr, "Can't find winsock\n");
+ return 1;
+ }
+ _fmode = _O_BINARY;
+ }
+#endif
+
FirstTab = NULL;
LastTab = NULL;
nTab = 0;
@@ -5728,6 +5755,9 @@ w3m_exit(int i)
#ifdef USE_NNTP
disconnectNews();
#endif
+#ifdef __MINGW32_VERSION
+ WSACleanup();
+#endif
exit(i);
}
@@ -6452,7 +6482,9 @@ download_action(struct parsed_tagarg *arg)
for (; arg; arg = arg->next) {
if (!strncmp(arg->arg, "stop", 4)) {
pid = (pid_t) atoi(&arg->arg[4]);
+#ifndef __MINGW32_VERSION
kill(pid, SIGKILL);
+#endif
}
else if (!strncmp(arg->arg, "ok", 2))
pid = (pid_t) atoi(&arg->arg[2]);
@@ -6486,7 +6518,9 @@ stopDownload(void)
for (d = FirstDL; d != NULL; d = d->next) {
if (d->ok)
continue;
+#ifndef __MINGW32_VERSION
kill(d->pid, SIGKILL);
+#endif
unlink(d->lock);
}
}