-/* Asynchronous subprocess implemenation for Win32
+/* Asynchronous subprocess implementation for Win32
Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995
Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
#include "sysdep.h"
#include <windows.h>
+#ifndef __MINGW32__
#include <shellapi.h>
+#else
+#include <errno.h>
+#endif
#include <signal.h>
#ifdef HAVE_SOCKETS
#include <winsock.h>
/* Bound by winnt.el */
Lisp_Object Qnt_quote_process_args;
-/* Implemenation-specific data. Pointed to by Lisp_Process->process_data */
+/* Implementation-specific data. Pointed to by Lisp_Process->process_data */
struct nt_process_data
{
HANDLE h_process;
sigkill_data d;
d.adr_ExitProcess = GetProcAddress (h_kernel, "ExitProcess");
assert (d.adr_ExitProcess);
- retval = run_in_other_process (h_process, sigkill_proc,
+ retval = run_in_other_process (h_process,
+ (LPTHREAD_START_ROUTINE)sigkill_proc,
&d, sizeof (d));
break;
}
GetProcAddress (h_kernel, "GenerateConsoleCtrlEvent");
assert (d.adr_GenerateConsoleCtrlEvent);
d.event = CTRL_C_EVENT;
- retval = run_in_other_process (h_process, sigint_proc,
+ retval = run_in_other_process (h_process,
+ (LPTHREAD_START_ROUTINE)sigint_proc,
&d, sizeof (d));
break;
}
d.adr_SetConsoleCtrlHandler =
GetProcAddress (h_kernel, "SetConsoleCtrlHandler");
assert (d.adr_SetConsoleCtrlHandler);
- run_in_other_process (h_process, sig_enable_proc,
+ run_in_other_process (h_process, (LPTHREAD_START_ROUTINE)sig_enable_proc,
&d, sizeof (d));
}
}
/*
- * Initialize XEmacs process implemenation once
+ * Initialize XEmacs process implementation once
*/
static void
nt_init_process (void)
* object. If this function signals, the caller is responsible for
* deleting (and finalizing) the process object.
*
- * The method must return PID of the new proces, a (positive??? ####) number
+ * The method must return PID of the new process, a (positive??? ####) number
* which fits into Lisp_Int. No return value indicates an error, the method
* must signal an error instead.
*/
}
/*
- * Stuff the entire contents of LSTREAM to the process ouptut pipe
+ * Stuff the entire contents of LSTREAM to the process output pipe
*/
/* #### If only this function could be somehow merged with
/* use a reasonable-sized buffer (somewhere around the size of the
stream buffer) so as to avoid inundating the stream with blocked
data. */
- Bufbyte chunkbuf[512];
+ Bufbyte chunkbuf[128];
Bytecount chunklen;
while (1)
{
int writeret;
- chunklen = Lstream_read (lstream, chunkbuf, 512);
+ chunklen = Lstream_read (lstream, chunkbuf, 128);
if (chunklen <= 0)
break; /* perhaps should abort() if < 0?
This should never happen. */
/* We don't want to be blocked on connect */
{
- unsigned int nonblock = 1;
+ unsigned long nonblock = 1;
ioctlsocket (s, FIONBIO, &nonblock);
}
if (nsel > 0)
{
- /* Check was connnection successful or not */
+ /* Check: was connection successful or not? */
tv.tv_usec = 0;
nsel = select (0, NULL, NULL, &fdset, &tv);
if (nsel > 0)