1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Fix unportable pid_t printing in calltrace(3).

This commit is contained in:
Jonas 'Sortie' Termansen 2013-12-28 21:47:49 +01:00
parent 7fbd8cdfa6
commit ac3928bfc8

View file

@ -24,6 +24,7 @@
#include <calltrace.h> #include <calltrace.h>
#include <errno.h> #include <errno.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
@ -31,13 +32,13 @@ extern "C" void asm_calltrace();
extern "C" void calltrace_print_function(size_t index, unsigned long ip) extern "C" void calltrace_print_function(size_t index, unsigned long ip)
{ {
fprintf(stdout, "[pid=%i %s] %zu: 0x%lx\n", getpid(), fprintf(stdout, "[pid=%ji %s] %zu: 0x%lx\n", (intmax_t) getpid(),
program_invocation_short_name, index, ip); program_invocation_short_name, index, ip);
} }
extern "C" void calltrace() extern "C" void calltrace()
{ {
fprintf(stdout, "[pid=%i %s] Calltrace: (%s)\n", getpid(), fprintf(stdout, "[pid=%ji %s] Calltrace: (%s)\n", (intmax_t) getpid(),
program_invocation_short_name, program_invocation_name); program_invocation_short_name, program_invocation_name);
asm_calltrace(); asm_calltrace();
} }