From nobody Wed Feb 09 00:48:06 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F2E1D19B6F69; Wed, 9 Feb 2022 00:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jth7V74Yvz4tVr; Wed, 9 Feb 2022 00:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644367687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mpc8k2s59JF3i9tFTs+ngIqz6Bys+5A61mP8CfjSzGo=; b=wPR8cNfcskB9QVSvPJjNsh6AnRV227ityXobRGtHXALqiAxqxQQ+4is481n25ECQsaB5+0 8cpWX6Fb/e1pk22TK98S3asRi8BppKWfP9yU8jZ59cEoF+zAdrtzwtWUTNz3859pSE590Z 2MhAvVnaRRht+JmneuTNJS7NUyh+ndwviSrRZ3KyBN03SibzEWNqxIe/ZB8fnvM6pj14Un CfVHnq2W6DpcmjgZ7qmahui/gwiihnFlqf70INSBi6qYyjDfFcb4PZOO/2bI9/54+udvIX Q0kkRglxQwcrrcyzJTRYmbUKsQFNkxAIdP1qsjZGVUMFx4rOL/X3d9tnCHRj0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1945237D9; Wed, 9 Feb 2022 00:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2190m6bk083667; Wed, 9 Feb 2022 00:48:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2190m6DA083666; Wed, 9 Feb 2022 00:48:06 GMT (envelope-from git) Date: Wed, 9 Feb 2022 00:48:06 GMT Message-Id: <202202090048.2190m6DA083666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 236a826c1478 - stable/13 - xlocale.c:init_key(): do not ignore errors from pthread_key_create() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 236a826c1478fcec6f8037222564b3f1555483dc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644367687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mpc8k2s59JF3i9tFTs+ngIqz6Bys+5A61mP8CfjSzGo=; b=o0sTu8gh2IqUY45hNVboyGo5eBZs5Z7Lw5aPWuup87KXFGxpI2vRlIX1NsQ9wcH+UghSXr osjqaa+FIW8KDZ5XBJSDxi6JIG1VEPHBRzGy67KfuNGJ1nwcOZvCdH5TM0wWPWp17P5ARq QMJP5xkN8dCHmeygYeQ5cW9523A7BZmr3opgfmKgy8/NJjU8RryZYEFLJxl3+p7p/WZL03 uyAAxdJKyjTOLFYJanbzG3u1T93QkfwzPq4PGGfPj2+A0GreTFJc9n9yPcoxXNexcYqdCT 1bLRX08I2QSH31JyY0yPLH8hToQdjnKXzdo56uAyiYNDPmzsGskTSAjRbXnJ8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644367687; a=rsa-sha256; cv=none; b=jLV8TzpOipqW9yaBEX+dg/SNjMTNXcXt8KTwj61KvSBt8csz8dgAoXLOUZ2YK3EAzqDvxn 4mFLAbQ5DxBGi2ZDOjAFyBshdxds4lGe1eIlit4H/BTYyCEYOvzy+o4i5TAqjsDjSvhIx2 cedXyDFxqZgG9kzlfC1UlKkjwvKu57MYI57yKlHbWrzmR8AMwuzQM5uZ9qD3f+3OWXVqX9 mcCn76VX0Udp3KO8Q4AuRepZ+lzVYjpDNE5wSX6zbhQUsr8mdowr1VNRs84l7EVeTzupKW p3997xOg49iUGQjW+er3uLGm6qqez1DomfIyYMv7xnId5XE1QMfbCMEEZkwmPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=236a826c1478fcec6f8037222564b3f1555483dc commit 236a826c1478fcec6f8037222564b3f1555483dc Author: Konstantin Belousov AuthorDate: 2022-02-02 17:23:55 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-09 00:42:45 +0000 xlocale.c:init_key(): do not ignore errors from pthread_key_create() (cherry picked from commit fcdf9d7de5363259e33be29bccc8b2b5dc091af8) --- lib/libc/locale/xlocale.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c index 528403693ad4..e07568775394 100644 --- a/lib/libc/locale/xlocale.c +++ b/lib/libc/locale/xlocale.c @@ -117,11 +117,16 @@ static locale_t thread_local_locale; static void init_key(void) { + int error; - pthread_key_create(&locale_info_key, xlocale_release); - pthread_setspecific(locale_info_key, (void*)42); - if (pthread_getspecific(locale_info_key) == (void*)42) { - pthread_setspecific(locale_info_key, 0); + error = pthread_key_create(&locale_info_key, xlocale_release); + if (error == 0) { + pthread_setspecific(locale_info_key, (void*)42); + if (pthread_getspecific(locale_info_key) == (void*)42) { + pthread_setspecific(locale_info_key, 0); + } else { + fake_tls = 1; + } } else { fake_tls = 1; }