summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--w32/subproc/sub_proc.c29
2 files changed, 22 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 79ee216..0bc52cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2010-07-09 Eli Zaretskii <eliz@gnu.org>
+ * w32/subproc/sub_proc.c: Include stdint.h.
+ (sub_process_t): Use intptr_t for file handles and pid_t for
+ process ID.
+ (process_pipes, process_init_fd, process_begin): Use intptr_t for
+ file handles and pid_t for process ID.
+ Savannah bug #27809. Patch by Ozkan Sezer <sezeroz@gmail.com>
+
* function.c (abspath): Support absolute file names in UNC format.
(Savannah bug #30312.)
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c
index 882b674..2b1b364 100644
--- a/w32/subproc/sub_proc.c
+++ b/w32/subproc/sub_proc.c
@@ -17,6 +17,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <stdio.h>
+#include <stdint.h>
#include <process.h> /* for msvc _beginthreadex, _endthreadex */
#include <signal.h>
#include <windows.h>
@@ -31,9 +32,9 @@ static char *make_command_line(char *shell_name, char *exec_path, char **argv);
extern char *xmalloc (unsigned int);
typedef struct sub_process_t {
- int sv_stdin[2];
- int sv_stdout[2];
- int sv_stderr[2];
+ intptr_t sv_stdin[2];
+ intptr_t sv_stdout[2];
+ intptr_t sv_stderr[2];
int using_pipes;
char *inp;
DWORD incnt;
@@ -41,7 +42,7 @@ typedef struct sub_process_t {
volatile DWORD outcnt;
char * volatile errp;
volatile DWORD errcnt;
- int pid;
+ pid_t pid;
int exit_code;
int signal;
long last_err;
@@ -310,12 +311,12 @@ process_init()
pproc->lerrno = E_SCALL;
return((HANDLE)pproc);
}
- pproc->sv_stdin[0] = (int) stdin_pipes[0];
- pproc->sv_stdin[1] = (int) stdin_pipes[1];
- pproc->sv_stdout[0] = (int) stdout_pipes[0];
- pproc->sv_stdout[1] = (int) stdout_pipes[1];
- pproc->sv_stderr[0] = (int) stderr_pipes[0];
- pproc->sv_stderr[1] = (int) stderr_pipes[1];
+ pproc->sv_stdin[0] = (intptr_t) stdin_pipes[0];
+ pproc->sv_stdin[1] = (intptr_t) stdin_pipes[1];
+ pproc->sv_stdout[0] = (intptr_t) stdout_pipes[0];
+ pproc->sv_stdout[1] = (intptr_t) stdout_pipes[1];
+ pproc->sv_stderr[0] = (intptr_t) stderr_pipes[0];
+ pproc->sv_stderr[1] = (intptr_t) stderr_pipes[1];
pproc->using_pipes = 1;
@@ -337,9 +338,9 @@ process_init_fd(HANDLE stdinh, HANDLE stdouth, HANDLE stderrh)
* Just pass the provided file handles to the 'child side' of the
* pipe, bypassing pipes altogether.
*/
- pproc->sv_stdin[1] = (int) stdinh;
- pproc->sv_stdout[1] = (int) stdouth;
- pproc->sv_stderr[1] = (int) stderrh;
+ pproc->sv_stdin[1] = (intptr_t) stdinh;
+ pproc->sv_stdout[1] = (intptr_t) stdouth;
+ pproc->sv_stderr[1] = (intptr_t) stderrh;
pproc->last_err = pproc->lerrno = 0;
@@ -575,7 +576,7 @@ process_begin(
}
}
- pproc->pid = (int)procInfo.hProcess;
+ pproc->pid = (pid_t)procInfo.hProcess;
/* Close the thread handle -- we'll just watch the process */
CloseHandle(procInfo.hThread);