From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 60B4913835A for ; Thu, 21 Jan 2021 07:14:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6AADDE0857; Thu, 21 Jan 2021 07:14:57 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 55218E0857 for ; Thu, 21 Jan 2021 07:14:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ACD33340CFB for ; Thu, 21 Jan 2021 07:14:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 63BB9CC for ; Thu, 21 Jan 2021 07:14:53 +0000 (UTC) From: "Joonas Niilola" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Joonas Niilola" Message-ID: <1611210009.816bbe85535e4e3bfb07940b4529306a889babf4.juippis@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/bees/, sys-fs/bees/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/bees/bees-9999.ebuild sys-fs/bees/files/v9999-0001-HACK-musl-does-not-define-pthread_getname_np.patch X-VCS-Directories: sys-fs/bees/ sys-fs/bees/files/ X-VCS-Committer: juippis X-VCS-Committer-Name: Joonas Niilola X-VCS-Revision: 816bbe85535e4e3bfb07940b4529306a889babf4 X-VCS-Branch: master Date: Thu, 21 Jan 2021 07:14:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1ea8c62f-aba2-4bff-a85f-649446ca5f8b X-Archives-Hash: a89884837a5a0a96f05769494ce670b5 commit: 816bbe85535e4e3bfb07940b4529306a889babf4 Author: Kai Krakow kaishome de> AuthorDate: Wed Jan 6 19:57:46 2021 +0000 Commit: Joonas Niilola gentoo org> CommitDate: Thu Jan 21 06:20:09 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=816bbe85 sys-fs/bees: Rebased musl patch for -9999 Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Kai Krakow kaishome.de> Closes: https://github.com/gentoo/gentoo/pull/18968 Signed-off-by: Joonas Niilola gentoo.org> sys-fs/bees/bees-9999.ebuild | 2 +- ...K-musl-does-not-define-pthread_getname_np.patch | 50 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/sys-fs/bees/bees-9999.ebuild b/sys-fs/bees/bees-9999.ebuild index 6c38f7b9c91..d656c4e6cde 100644 --- a/sys-fs/bees/bees-9999.ebuild +++ b/sys-fs/bees/bees-9999.ebuild @@ -29,7 +29,7 @@ RDEPEND="${DEPEND}" CONFIG_CHECK="~BTRFS_FS" ERROR_BTRFS_FS="CONFIG_BTRFS_FS: bees does currently only work with btrfs" -PATCHES=( "${FILESDIR}/0001-HACK-musl-does-not-define-pthread_getname_np.patch" ) +PATCHES=( "${FILESDIR}/v9999-0001-HACK-musl-does-not-define-pthread_getname_np.patch" ) pkg_pretend() { if [[ ${MERGE_TYPE} != buildonly ]]; then diff --git a/sys-fs/bees/files/v9999-0001-HACK-musl-does-not-define-pthread_getname_np.patch b/sys-fs/bees/files/v9999-0001-HACK-musl-does-not-define-pthread_getname_np.patch new file mode 100644 index 00000000000..6b8224a5a56 --- /dev/null +++ b/sys-fs/bees/files/v9999-0001-HACK-musl-does-not-define-pthread_getname_np.patch @@ -0,0 +1,50 @@ +From 02bdb636be5abd15836e5e43e9b53517595686c9 Mon Sep 17 00:00:00 2001 +From: Kai Krakow +Date: Thu, 16 Apr 2020 21:21:57 +0200 +Subject: [PATCH v9999] HACK: musl does not define pthread_getname_np() + +The glibc alternative musl does not define this setter function. This +fix is probably wrong because it resets the thread names used for +logging internally to empty strings. + +Link: https://www.openwall.com/lists/musl/2019/07/17/3 +Signed-off-by: Kai Krakow +--- + lib/task.cc | 2 ++ + src/bees.cc | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/lib/task.cc b/lib/task.cc +index 937a477..85da59b 100644 +--- a/lib/task.cc ++++ b/lib/task.cc +@@ -194,7 +194,9 @@ namespace crucible { + lock.unlock(); + + char buf[24] = { 0 }; ++#ifdef _GNU_SOURCE + DIE_IF_MINUS_ERRNO(pthread_getname_np(pthread_self(), buf, sizeof(buf))); ++#endif + DIE_IF_MINUS_ERRNO(pthread_setname_np(pthread_self(), m_title.c_str())); + + sched_param param = { .sched_priority = 0 }; +diff --git a/src/bees.cc b/src/bees.cc +index 03a626c..3db5d73 100644 +--- a/src/bees.cc ++++ b/src/bees.cc +@@ -152,10 +152,12 @@ BeesNote::get_name() + // OK try the pthread name next. + char buf[24]; + memset(buf, '\0', sizeof(buf)); ++#ifdef _GNU_SOURCE + int err = pthread_getname_np(pthread_self(), buf, sizeof(buf)); + if (err) { + return string("pthread_getname_np: ") + strerror(err); + } ++#endif + buf[sizeof(buf) - 1] = '\0'; + + // thread_getname_np returns process name +-- +2.26.2 +