Cast `getpid()` to `long long` before printing

Follow-up to commit 41441a65f.
That commit fixed the issue in runtime/ .
The present commit fixes the issue in ocamltest/ .
master
Xavier Leroy 2020-04-20 12:00:03 +02:00
parent a40889d6d9
commit 974b9ca1a2
1 changed files with 5 additions and 5 deletions

View File

@ -248,8 +248,8 @@ static int handle_process_termination(
if (WIFEXITED(status)) return WEXITSTATUS(status);
if ( !WIFSIGNALED(status) )
error("Process %d neither terminated normally nor received a" \
"signal!?", pid);
error("Process %lld neither terminated normally nor received a" \
"signal!?", (long long) pid);
/* From here we know that the process terminated due to a signal */
signal = WTERMSIG(status);
@ -258,8 +258,8 @@ static int handle_process_termination(
#endif /* WCOREDUMP */
corestr = core ? "" : "no ";
fprintf(stderr,
"Process %d got signal %d(%s), %score dumped\n",
pid, signal, strsignal(signal), corestr
"Process %lld got signal %d(%s), %score dumped\n",
(long long) pid, signal, strsignal(signal), corestr
);
if (core)
@ -273,7 +273,7 @@ static int handle_process_termination(
fprintf(stderr, "Out of memory while processing core file.\n");
else {
snprintf(corefile, corefile_len,
"%s.%d.core", corefilename_prefix, pid);
"%s.%lld.core", corefilename_prefix, (long long) pid);
if ( rename(COREFILENAME, corefile) == -1)
fprintf(stderr, "The core file exists but could not be renamed.\n");
else