[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 17/53: exec: provide a meaningful name for new tasks
From: |
Samuel Thibault |
Subject: |
[hurd] 17/53: exec: provide a meaningful name for new tasks |
Date: |
Thu, 20 Mar 2014 02:23:50 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 4473d16e7cdad08eccad95f5920e1aa171d5512d
Author: Justus Winter <address@hidden>
Date: Fri Feb 21 14:58:21 2014 +0100
exec: provide a meaningful name for new tasks
The name will be used in error messages printed by the kernel. This
makes attributing the errors to processes possible.
* exec/exec.c (do_exec): Set the name of the new task.
---
exec/exec.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/exec/exec.c b/exec/exec.c
index fad9492..e693f63 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1151,14 +1151,29 @@ do_exec (file_t file,
}
boot->user_entry = e.entry; /* already adjusted in `load' */
- /* Set the start_code and end_code values for this process.
- /hurd/exec is used to start /hurd/proc, so at this point there is
+ /* /hurd/exec is used to start /hurd/proc, so at this point there is
no proc server, so we need to be careful here. */
if (boot->portarray[INIT_PORT_PROC] != MACH_PORT_NULL)
- e.error = proc_set_code (boot->portarray[INIT_PORT_PROC],
- e.start_code, e.end_code);
- if (e.error)
- goto out;
+ {
+ /* Set the start_code and end_code values for this process. */
+ e.error = proc_set_code (boot->portarray[INIT_PORT_PROC],
+ e.start_code, e.end_code);
+ if (e.error)
+ goto out;
+
+ pid_t pid;
+ e.error = proc_task2pid (boot->portarray[INIT_PORT_PROC],
+ newtask, &pid);
+ if (e.error)
+ goto out;
+
+ char *name;
+ if (asprintf (&name, "%s(%d)", argv, pid) > 0)
+ {
+ task_set_name (newtask, name);
+ free (name);
+ }
+ }
/* Create the initial thread. */
e.error = thread_create (newtask, &thread);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 43/53: mach-defpager: fix error handling in S_default_pager_object_set_size, (continued)
- [hurd] 43/53: mach-defpager: fix error handling in S_default_pager_object_set_size, Samuel Thibault, 2014/03/19
- [hurd] 03/53: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/03/19
- [hurd] 39/53: auth: improve the mig mutator functions, Samuel Thibault, 2014/03/19
- [hurd] 01/53: trans/fakeroot: fix cached node retrieval on lookup, Samuel Thibault, 2014/03/19
- [hurd] 10/53: Add missing copyright notice, Samuel Thibault, 2014/03/19
- [hurd] 06/53: Fix typos, Samuel Thibault, 2014/03/19
- [hurd] 19/53: utils/umount: do not remove passive translator records, Samuel Thibault, 2014/03/19
- [hurd] 16/53: pfinet: set a non-zero ports management timeout, Samuel Thibault, 2014/03/19
- [hurd] 14/53: libstore: fixed some pointer-sign related warnings, Samuel Thibault, 2014/03/19
- [hurd] 22/53: mach-defpager: add function mig_reply_setup, Samuel Thibault, 2014/03/19
- [hurd] 17/53: exec: provide a meaningful name for new tasks,
Samuel Thibault <=
- [hurd] 20/53: libpager: improve the pager_demuxer function, Samuel Thibault, 2014/03/19
- [hurd] 21/53: mach-defpager: fix definition of seqnos_memory_object_data_unlock, Samuel Thibault, 2014/03/19
- [hurd] 23/53: mach-defpager: improve the default_pager_demux_object function, Samuel Thibault, 2014/03/19
- [hurd] 18/53: Fix fakeroot and remap parsing corner cases, Samuel Thibault, 2014/03/19
- [hurd] 15/53: libports: work around bugs in server termination, Samuel Thibault, 2014/03/19
- [hurd] 27/53: tmpfs: set diskfs_disk_name to "none", Samuel Thibault, 2014/03/19
- [hurd] 25/53: nfs: implement netfs_get_source, Samuel Thibault, 2014/03/19
- [hurd] 26/53: trans/mtab: ignore translators that do not implement file_get_source, Samuel Thibault, 2014/03/19
- [hurd] 08/53: Add --font-width option to force 8/9 pixel font width, Samuel Thibault, 2014/03/19
- [hurd] 36/53: term: fix receiver lookups in the tioctl server functions, Samuel Thibault, 2014/03/19