Skip to content

Commit

Permalink
tree-wide: properly name all threads we fork off
Browse files Browse the repository at this point in the history
  • Loading branch information
poettering committed Dec 25, 2017
1 parent 451cdf7 commit fa7ff4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/basic/async.c
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions src/journal/journal-file.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libsystemd/sd-resolve/sd-resolve.c
Expand Up @@ -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 {
Expand Down

0 comments on commit fa7ff4c

Please sign in to comment.