summaryrefslogtreecommitdiff
path: root/w32
diff options
context:
space:
mode:
Diffstat (limited to 'w32')
-rw-r--r--w32/.cvsignore1
-rw-r--r--w32/Makefile.am8
-rw-r--r--w32/subproc/sub_proc.c13
-rw-r--r--w32/subproc/w32err.c7
4 files changed, 22 insertions, 7 deletions
diff --git a/w32/.cvsignore b/w32/.cvsignore
new file mode 100644
index 0000000..6179e0d
--- /dev/null
+++ b/w32/.cvsignore
@@ -0,0 +1 @@
+Makefile Makefile.in
diff --git a/w32/Makefile.am b/w32/Makefile.am
new file mode 100644
index 0000000..fd6743d
--- /dev/null
+++ b/w32/Makefile.am
@@ -0,0 +1,8 @@
+# Makefile.am to create libw32.a for mingw32 host.
+
+noinst_LIBRARIES = libw32.a
+
+libw32_a_SOURCES = subproc/misc.c subproc/sub_proc.c subproc/w32err.c \
+ pathstuff.c
+
+libw32_a_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/subproc -I$(top_srcdir)
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c
index bf1e732..63911fc 100644
--- a/w32/subproc/sub_proc.c
+++ b/w32/subproc/sub_proc.c
@@ -664,13 +664,13 @@ process_pipe_io(
DWORD wait_return;
HANDLE ready_hand;
bool_t child_dead = FALSE;
-
+ BOOL GetExitCodeResult;
/*
* Create stdin thread, if needed
*/
- pproc->inp = stdin_data;
- pproc->incnt = stdin_data_len;
+ pproc->inp = stdin_data;
+ pproc->incnt = stdin_data_len;
if (!pproc->inp) {
stdin_eof = TRUE;
CloseHandle((HANDLE)pproc->sv_stdin[0]);
@@ -762,7 +762,8 @@ process_pipe_io(
} else if (ready_hand == childhand) {
- if (GetExitCodeProcess(childhand, &pproc->exit_code) == FALSE) {
+ GetExitCodeResult = GetExitCodeProcess(childhand, (DWORD*)&pproc->exit_code);
+ if (GetExitCodeResult == FALSE) {
pproc->last_err = GetLastError();
pproc->lerrno = E_SCALL;
goto done;
@@ -809,6 +810,7 @@ process_file_io(
sub_process *pproc;
HANDLE childhand;
DWORD wait_return;
+ BOOL GetExitCodeResult;
if (proc == NULL)
pproc = process_wait_for_any_private();
@@ -852,7 +854,8 @@ process_file_io(
goto done2;
}
- if (GetExitCodeProcess(childhand, &pproc->exit_code) == FALSE) {
+ GetExitCodeResult = GetExitCodeProcess(childhand, (DWORD*)&pproc->exit_code);
+ if (GetExitCodeResult == FALSE) {
pproc->last_err = GetLastError();
pproc->lerrno = E_SCALL;
}
diff --git a/w32/subproc/w32err.c b/w32/subproc/w32err.c
index 9bfa2c4..712fccd 100644
--- a/w32/subproc/w32err.c
+++ b/w32/subproc/w32err.c
@@ -11,9 +11,12 @@
*/
char *
map_windows32_error_to_string (DWORD ercode) {
-/* __declspec (thread) necessary if you will use multiple threads */
+/* __declspec (thread) necessary if you will use multiple threads on MSVC */
+#ifdef _MSC_VER
__declspec (thread) static char szMessageBuffer[128];
-
+#else
+static char szMessageBuffer[128];
+#endif
/* Fill message buffer with a default message in
* case FormatMessage fails
*/