process-util: debug log if PR_SET_NAME fails.
This commit is contained in:
parent
1096bb8a9e
commit
5a8af74711
|
@ -304,8 +304,10 @@ int rename_process(const char name[]) {
|
||||||
|
|
||||||
l = strlen(name);
|
l = strlen(name);
|
||||||
|
|
||||||
/* First step, change the comm field. */
|
/* First step, change the comm field. The main thread's comm is identical to the process comm. This means we
|
||||||
(void) prctl(PR_SET_NAME, 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 > 15) /* Linux process names can be 15 chars at max */
|
||||||
truncated = true;
|
truncated = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue