projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1096bb8
)
process-util: debug log if PR_SET_NAME fails.
author
Lennart Poettering
<lennart@poettering.net>
Sun, 24 Dec 2017 17:50:17 +0000
(18:50 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 25 Dec 2017 10:48:21 +0000
(11:48 +0100)
src/basic/process-util.c
patch
|
blob
|
history
diff --git
a/src/basic/process-util.c
b/src/basic/process-util.c
index 2516730a8ac560d515645788581de04221591163..05373689eaa5d474e55fb98a0bef4da94da1eec2 100644
(file)
--- a/
src/basic/process-util.c
+++ b/
src/basic/process-util.c
@@
-304,8
+304,10
@@
int rename_process(const char name[]) {
l = strlen(name);
- /* First step, change the comm field. */
- (void) prctl(PR_SET_NAME, name);
+ /* First step, change the comm field. The main thread's comm is identical to the process comm. This means we
+ * can use PR_SET_NAME, which sets the thread name for the calling thread. */
+ if (prctl(PR_SET_NAME, name) < 0)
+ log_debug_errno(errno, "PR_SET_NAME failed: %m");
if (l > 15) /* Linux process names can be 15 chars at max */
truncated = true;