summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-12-05 01:34:56 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-06 02:12:34 +0100
commitc644533e2a8cd395997609f7e33b1e38c27e40f0 (patch)
tree6ec9c9f898c7d232b3f6508d046f362ec03de5e7 /libshouldbeinlibc
parent1cebd0baa3450d5c1c745874836555df6432e04e (diff)
Fix *printf specifier for user space mach ports.
mach_port_t are mach_port_name_t and thus require %u instead of %lu. Message-Id: <Y42RELMbulK4xaKM@reue>
Diffstat (limited to 'libshouldbeinlibc')
-rw-r--r--libshouldbeinlibc/portinfo.c8
-rw-r--r--libshouldbeinlibc/xportinfo.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/libshouldbeinlibc/portinfo.c b/libshouldbeinlibc/portinfo.c
index a023446a..42b22081 100644
--- a/libshouldbeinlibc/portinfo.c
+++ b/libshouldbeinlibc/portinfo.c
@@ -72,7 +72,7 @@ print_port_info (mach_port_t name, mach_port_type_t type, task_t task,
return err;
}
- fprintf (stream, hex_names ? "%#6lx: " : "%6lu: ", name);
+ fprintf (stream, hex_names ? "%#6x: " : "%6u: ", name);
if (type & MACH_PORT_TYPE_RECEIVE)
{
@@ -480,7 +480,7 @@ print_port_info (mach_port_t name, mach_port_type_t type, task_t task,
fprintf (stream, " (");
if (status.mps_pset != MACH_PORT_NULL)
fprintf (stream,
- hex_names ? "port-set: %#lx, " : "port-set: %lu, ",
+ hex_names ? "port-set: %#x, " : "port-set: %u, ",
status.mps_pset);
fprintf (stream, "seqno: %zu", status.mps_seqno);
if (status.mps_mscount)
@@ -514,9 +514,9 @@ print_port_info (mach_port_t name, mach_port_type_t type, task_t task,
fprintf (stream, " (empty)");
else
{
- fprintf (stream, hex_names ? " (%#lx" : " (%lu", members[0]);
+ fprintf (stream, hex_names ? " (%#x" : " (%u", members[0]);
for (i = 1; i < members_len; i++)
- fprintf (stream, hex_names ? ", %#lx" : ", %lu",
+ fprintf (stream, hex_names ? ", %#x" : ", %u",
members[i]);
fprintf (stream, ")");
munmap ((caddr_t) members, members_len * sizeof *members);
diff --git a/libshouldbeinlibc/xportinfo.c b/libshouldbeinlibc/xportinfo.c
index 47e6dd9a..2a6d6f69 100644
--- a/libshouldbeinlibc/xportinfo.c
+++ b/libshouldbeinlibc/xportinfo.c
@@ -35,7 +35,7 @@ print_xlated_port_info (mach_port_t name, mach_port_type_t type,
error_t err = port_name_xlator_xlate (x, name, type, &name, &type);
if (! err)
{
- fprintf (stream, (show & PORTINFO_HEX_NAMES) ? "%#6lx => " : "%6lu => ",
+ fprintf (stream, (show & PORTINFO_HEX_NAMES) ? "%#6x => " : "%6u => ",
old_name);
err = print_port_info (name, type, x->to_task, show, stream);
}