bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[committed mach] kern: inherit the name of the parent task


From: Justus Winter
Subject: [committed mach] kern: inherit the name of the parent task
Date: Wed, 25 Feb 2015 17:53:59 +0100

* kern/task.c (task_create): Inherit the name of the parent task.
---
 kern/task.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kern/task.c b/kern/task.c
index a11fb8e..57e7f41 100644
--- a/kern/task.c
+++ b/kern/task.c
@@ -171,7 +171,12 @@ kern_return_t task_create(
        }
 #endif /* FAST_TAS */
 
-       snprintf (new_task->name, sizeof new_task->name, "%p", new_task);
+       if (parent_task == TASK_NULL)
+               snprintf (new_task->name, sizeof new_task->name, "%p",
+                         new_task);
+       else
+               snprintf (new_task->name, sizeof new_task->name, "(%.*s)",
+                         sizeof new_task->name - 3, parent_task->name);
 
        if (new_task_notification != NULL) {
                task_reference (new_task);
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]