summaryrefslogtreecommitdiff
path: root/src/basic/process-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-06-01 21:43:43 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit0ebd32d1cd1069a849c2c3968b632834fe1fc577 (patch)
treef095dbe6e17fe4b762060090f1b17a08916dd716 /src/basic/process-util.c
parentc7beed3ba1b20cd87dfce3ab622232ed9eb201f2 (diff)
missing: define kernel internal limit TASK_COMM_LEN in userspace too
We already use it at two places, and we are about to add one too. Arbitrary literally hardcoded limits suck.
Diffstat (limited to 'src/basic/process-util.c')
-rw-r--r--src/basic/process-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 1484a0011..f74eebd58 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -296,7 +296,7 @@ int rename_process(const char name[]) {
* 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 */
+ if (l >= TASK_COMM_LEN) /* Linux process names can be 15 chars at max */
truncated = true;
/* Second step, change glibc's ID of the process name. */