From b85b7e0a55d0a82cf4d108a022d2768483ddc4b6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 9 Jul 2010 12:05:10 +0000 Subject: 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 --- w32/subproc/sub_proc.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'w32') 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 . */ #include #include +#include #include /* for msvc _beginthreadex, _endthreadex */ #include #include @@ -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); -- cgit v1.2.3