[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 22/61: exec: abbreviate the task name if necessary
From: |
Samuel Thibault |
Subject: |
[hurd] 22/61: exec: abbreviate the task name if necessary |
Date: |
Tue, 27 May 2014 08:32:11 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit ceffc4581e83ce1299c96a17c9c5352f491d488d
Author: Justus Winter <address@hidden>
Date: Sun Apr 27 08:43:17 2014 +0200
exec: abbreviate the task name if necessary
* exec/exec.c (do_exec): If the formatted task name exceeds
TASK_NAME_SIZE, abbreviate it.
---
exec/exec.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/exec/exec.c b/exec/exec.c
index 935762e..b068f5e 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1168,9 +1168,20 @@ do_exec (file_t file,
goto out;
char *name;
- if (asprintf (&name, "%s(%d)", argv, pid) > 0)
+ int size = asprintf (&name, "%s(%d)", argv, pid);
+ if (size > 0)
{
- task_set_name (newtask, name);
+/* This is an internal implementational detail of the gnumach kernel. */
+#define TASK_NAME_SIZE 32
+ if (size < TASK_NAME_SIZE)
+ task_set_name (newtask, name);
+ else
+ {
+ char *abbr = name + size - TASK_NAME_SIZE + 1;
+ abbr[0] = abbr[1] = abbr[2] = '.';
+ task_set_name (newtask, abbr);
+ }
+#undef TASK_NAME_SIZE
free (name);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 27/61: ext2fs: improve diskfs_node_iterate, (continued)
- [hurd] 27/61: ext2fs: improve diskfs_node_iterate, Samuel Thibault, 2014/05/27
- [hurd] 39/61: trans/fakeroot: remove spurious semicolon, Samuel Thibault, 2014/05/27
- [hurd] 36/61: libihash: use an integer hash function on the keys, Samuel Thibault, 2014/05/27
- [hurd] 41/61: trans/fakeroot: use C99-style struct initialization, Samuel Thibault, 2014/05/27
- [hurd] 40/61: trans/fakeroot: fix comparison between signed and unsigned, Samuel Thibault, 2014/05/27
- [hurd] 32/61: fatfs: use two distinct pager buckets for the disk and file pager, Samuel Thibault, 2014/05/27
- [hurd] 24/61: ext2fs: simplify expression, Samuel Thibault, 2014/05/27
- [hurd] 47/61: include: install refcount.h, Samuel Thibault, 2014/05/27
- [hurd] 50/61: exec: add missing includes, Samuel Thibault, 2014/05/27
- [hurd] 23/61: ext2fs: fix type of inum, Samuel Thibault, 2014/05/27
- [hurd] 22/61: exec: abbreviate the task name if necessary,
Samuel Thibault <=
- [hurd] 46/61: trans/fakeroot: override fshelp_isowner, Samuel Thibault, 2014/05/27
- [hurd] 37/61: libihash: use linear probing and fast modulo operation, Samuel Thibault, 2014/05/27
- [hurd] 44/61: libihash: add hurd_ihash_get_load, Samuel Thibault, 2014/05/27
- [hurd] 52/61: libdiskfs: fix type of dir_cache_id, node_cache_id, Samuel Thibault, 2014/05/27
- [hurd] 54/61: term: fix memory leak, Samuel Thibault, 2014/05/27
- [hurd] 48/61: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/05/27
- [hurd] 25/61: libports: reduce malloc overhead in _ports_bucket_class_iterate, Samuel Thibault, 2014/05/27
- [hurd] 42/61: proc: move translation functions to mig-decls.h, Samuel Thibault, 2014/05/27
- [hurd] 31/61: libports: unlock _ports_lock on malloc failure, Samuel Thibault, 2014/05/27
- [hurd] 61/61: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/05/27