summaryrefslogtreecommitdiff
path: root/function.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2010-07-09 11:10:04 +0000
committerEli Zaretskii <eliz@gnu.org>2010-07-09 11:10:04 +0000
commit4e4d8f246f82d492fb71bc599813016ef97be397 (patch)
treecc083fe16c68e8634a8d8b7054a5b34253993a55 /function.c
parent8a0f9d7b429b32b106d8f46d32c8d5213683fbda (diff)
downloadgunmake-4e4d8f246f82d492fb71bc599813016ef97be397.tar.gz
job.c (pid2str) [WINDOWS32]: Don't use %Id with GCC < 4.x.
(exec_command) [WINDOWS32]: Use pid2str instead of non-portable %Id. main.c (handle_runtime_exceptions): Use %p to print addresses, to DTRT on both 32-bit and 64-bit hosts. Savannah bug #27809. job.c (w32_kill, start_job_command, create_batch_file): Use pid_t for process IDs and intptr_t for the 1st arg of _open_osfhandle. function.c (windows32_openpipe): Use pid_t for process IDs and intptr_t for the 1st arg of _open_osfhandle. (func_shell): Use pid_t for process IDs. main.c (main) [WINDOWS32]: Pacify the compiler. config.h.W32.template (pid_t): Add a definition for 64-bit Windows builds that don't use GCC. Savannah bug #27809. Patch by Ozkan Sezer <sezeroz@gmail.com>
Diffstat (limited to 'function.c')
-rw-r--r--function.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/function.c b/function.c
index d2482b5..45ebc9e 100644
--- a/function.c
+++ b/function.c
@@ -1434,7 +1434,7 @@ int shell_function_pid = 0, shell_function_completed;
void
-windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
+windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp)
{
SECURITY_ATTRIBUTES saAttr;
HANDLE hIn;
@@ -1489,13 +1489,13 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
process_register(hProcess);
/* set the pid for returning to caller */
- *pid_p = (int) hProcess;
+ *pid_p = (pid_t) hProcess;
/* set up to read data from child */
- pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
+ pipedes[0] = _open_osfhandle((intptr_t) hChildOutRd, O_RDONLY);
/* this will be closed almost right away */
- pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
+ pipedes[1] = _open_osfhandle((intptr_t) hChildOutWr, O_APPEND);
} else {
/* reap/cleanup the failed process */
process_cleanup(hProcess);
@@ -1510,7 +1510,7 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
/* set status for return */
pipedes[0] = pipedes[1] = -1;
- *pid_p = -1;
+ *pid_p = (pid_t)-1;
}
}
#endif
@@ -1594,7 +1594,7 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
const char *error_prefix;
char **envp;
int pipedes[2];
- int pid;
+ pid_t pid;
#ifndef __MSDOS__
/* Construct the argument list. */