From: Lennart Poettering Date: Fri, 22 Dec 2017 12:31:55 +0000 (+0100) Subject: tree-wide: properly name all threads we fork off X-Git-Tag: v237~173^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa7ff4cf03e5f6becf4db847a11bbdbfc4382f58;p=platform%2Fupstream%2Fsystemd.git tree-wide: properly name all threads we fork off --- diff --git a/src/basic/async.c b/src/basic/async.c index 2c51883..ccd9eee 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 7fef403..844a94f 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 be3748e..0f369f4 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 {