diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-22 13:31:55 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-25 11:48:21 +0100 |
commit | fa7ff4cf03e5f6becf4db847a11bbdbfc4382f58 (patch) | |
tree | 3e6fb52be263d69c52295bad4ada0851de40cc2e | |
parent | 451cdf783098e0f7ee387ebf622e90320534902d (diff) | |
download | systemd-fa7ff4cf03e5f6becf4db847a11bbdbfc4382f58.tar.gz |
tree-wide: properly name all threads we fork off
-rw-r--r-- | src/basic/async.c | 2 | ||||
-rw-r--r-- | src/journal/journal-file.c | 2 | ||||
-rw-r--r-- | src/libsystemd/sd-resolve/sd-resolve.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/basic/async.c b/src/basic/async.c index 2c51883463..ccd9eeef52 100644 --- a/src/basic/async.c +++ b/src/basic/async.c @@ -81,6 +81,8 @@ int asynchronous_sync(pid_t *ret_pid) { } static void *close_thread(void *p) { + (void) pthread_setname_np(pthread_self(), "close"); + assert_se(close_nointr(PTR_TO_FD(p)) != -EBADF); return NULL; } diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 7fef403391..844a94f1b0 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -147,6 +147,8 @@ static void journal_file_set_offline_internal(JournalFile *f) { static void * journal_file_set_offline_thread(void *arg) { JournalFile *f = arg; + (void) pthread_setname_np(pthread_self(), "journal-offline"); + journal_file_set_offline_internal(f); return NULL; diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c index be3748e3ce..0f369f4917 100644 --- a/src/libsystemd/sd-resolve/sd-resolve.c +++ b/src/libsystemd/sd-resolve/sd-resolve.c @@ -405,7 +405,7 @@ static void* thread_worker(void *p) { assert_se(pthread_sigmask(SIG_BLOCK, &fullset, NULL) == 0); /* Assign a pretty name to this thread */ - (void) prctl(PR_SET_NAME, (unsigned long) "sd-resolve"); + (void) pthread_setname_np(pthread_self(), "sd-resolve"); while (!resolve->dead) { union { |