diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-12-05 01:34:56 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-12-06 02:12:34 +0100 |
commit | c644533e2a8cd395997609f7e33b1e38c27e40f0 (patch) | |
tree | 6ec9c9f898c7d232b3f6508d046f362ec03de5e7 /utils | |
parent | 1cebd0baa3450d5c1c745874836555df6432e04e (diff) | |
download | hurd-c644533e2a8cd395997609f7e33b1e38c27e40f0.tar.gz hurd-c644533e2a8cd395997609f7e33b1e38c27e40f0.tar.bz2 hurd-c644533e2a8cd395997609f7e33b1e38c27e40f0.zip |
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 'utils')
-rw-r--r-- | utils/rpctrace.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/rpctrace.c b/utils/rpctrace.c index b4de175c..f47d179a 100644 --- a/utils/rpctrace.c +++ b/utils/rpctrace.c @@ -353,7 +353,7 @@ new_send_wrapper (struct receiver_info *receive, task_t task, assert_perror_backtrace (err); TRACED_INFO (info)->name = 0; - asprintf (&TRACED_INFO (info)->name, " %lu<--%lu(pid%d)", + asprintf (&TRACED_INFO (info)->name, " %u<--%u(pid%d)", receive->forward, TRACED_INFO (info)->pi.port_right, task2pid (task)); TRACED_INFO (info)->type = MACH_MSG_TYPE_MOVE_SEND; info->task = task; @@ -979,7 +979,7 @@ wrap_all_threads (task_t task) task, &new_thread_port); free (TRACED_INFO (thread_send_wrapper)->name); asprintf (&TRACED_INFO (thread_send_wrapper)->name, - "thread%lu(pid%d)", threads[i], task2pid (task)); + "thread%u(pid%d)", threads[i], task2pid (task)); err = mach_port_insert_right (mach_task_self (), new_thread_port, new_thread_port, @@ -1031,7 +1031,7 @@ wrap_new_thread (mach_msg_header_t *inp, struct req_info *req) mach_port_deallocate (mach_task_self (), reply->child_thread); free (TRACED_INFO (send_wrapper)->name); - asprintf (&TRACED_INFO (send_wrapper)->name, "thread%lu(pid%d)", + asprintf (&TRACED_INFO (send_wrapper)->name, "thread%u(pid%d)", thread_port, task2pid (req->from)); ports_port_deref (send_wrapper); } @@ -1078,10 +1078,10 @@ wrap_new_task (mach_msg_header_t *inp, struct req_info *req) pid = task2pid (task_port); free (TRACED_INFO (task_wrapper1)->name); - asprintf (&TRACED_INFO (task_wrapper1)->name, "task%lu(pid%d)", + asprintf (&TRACED_INFO (task_wrapper1)->name, "task%u(pid%d)", task_port, task2pid (req->from)); free (TRACED_INFO (task_wrapper2)->name); - asprintf (&TRACED_INFO (task_wrapper2)->name, "task%lu(pid%d)", + asprintf (&TRACED_INFO (task_wrapper2)->name, "task%u(pid%d)", task_port, pid); ports_port_deref (task_wrapper1); } @@ -1648,7 +1648,7 @@ traced_spawn (char **argv, char **envp) ti = new_send_wrapper (receive_ti, traced_task, &task_wrapper); ti->task = traced_task; free (TRACED_INFO (ti)->name); - asprintf (&TRACED_INFO (ti)->name, "task%lu(pid%d)", traced_task, pid); + asprintf (&TRACED_INFO (ti)->name, "task%u(pid%d)", traced_task, pid); /* Replace the task's kernel port with the wrapper. When this task calls `mach_task_self ()', it will get our wrapper send right instead of its |