From nobody Thu Oct 2 08:20:43 2025 X-Original-To: dev-commits-src-all@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 4ccl9S2TTtz69KTp; Thu, 02 Oct 2025 08:20:44 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9R5tFWz4Mvh; Thu, 02 Oct 2025 08:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393243; 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=dz08MPEARtOmv9ZVF2omWbx05dTe5zrNkwOOqnZpx48=; b=WjxVj6zFi3bWjhwAqBHH7TZblb9nbFqz5vqzul7ziybBTcKqBmPoF3JXsuxTZjTobkGzsV 6mHYsY5prrHOI0GPKk1nOkYCZE8gNJ1clz7i7YsW24UI3IlMQPR+Wulq7BkVloSrbGC/96 gKyHyTPcIpuw56RSLbnMychNi/dGdPXU2e4Kj1F5bZHfaoM/gia4ntSWB5WedgxTIgRtYs SkyAyqqRAwj2e61d9tBidldGAul+S+sP940RXpxhO60fPQ9tRKRQ0A/7lYcgQnHo4sPLpA di0l16JSA0XWgrMh6wUIrfbesAVpMKV/eKxpuPAp72FMkDN/IkV1ivKNdvG1Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393243; 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=dz08MPEARtOmv9ZVF2omWbx05dTe5zrNkwOOqnZpx48=; b=XX8yxFP1jDb14puQ1LvOyQ7pbTHgQCA6WfX8GeWDVr91lt4qm1dUTk4DKOrhcTEuP6Dx/6 +k6DdrNg8WMQvmMQ34w8VQvD2lUcsyAuq5NxJVIu16pUGg4Rs0zNr6+Dgx7cSWRH4lJIzT Ek6Bb2rZFU8/bVq73sffC0yW1yYjcufQkqOfn9VIBmptJA8BYhXRplMy0R8w+5dHe1bLKb nu2yqyEItFfwUTXwCO7MNEIoFzfRtJ+zRsh1BP1Ox4OnnXAk0tssnrG7tPHrZNMl+WndXV 4r2yUoLmrF7xYVVMkFlBdj/wtMkPptdOL723uZnf6qjdGMt+YNJQUii5RlyTaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393243; a=rsa-sha256; cv=none; b=hYm8p7bTSTmYeOtGujp3UtLl0xwaCISCqen9RtSX3miiuXv7Jg3t6AFOQmJnm0FKhUKnpC rv20+TDzNs7VoG5+FdMwIeXmGg/jNKSnC26KdB02XV85pjnybb4wYCQw9UYF1bbOazrluw RVKw6GAOSAfjbD1SCy5zsbpLmmxk0VTNvk9pdLXjUW3ITFe1BAEcejZOoOKaH5rKy/4Zx3 fcAafFrx9DqmqRFPciv7iKF0bdOj2W4VQc1zjF1D8821UqAi4zLc455AWdlt5mM/5uJZ42 uxuS7KJT1ewbGdRbstBXeSbZwrFvZxy45VfW0Ikw3nQDq2RSTh9IHeBO2r5X3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4ccl9R5PxTz103M; Thu, 02 Oct 2025 08:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5928KhFO023167; Thu, 2 Oct 2025 08:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Khvk023164; Thu, 2 Oct 2025 08:20:43 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:43 GMT Message-Id: <202510020820.5928Khvk023164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a46136a8beb6 - stable/15 - tzcode: Drop libc namespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a46136a8beb60be82267b6a7b49304ae9a57f1eb Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a46136a8beb60be82267b6a7b49304ae9a57f1eb commit a46136a8beb60be82267b6a7b49304ae9a57f1eb Author: Dag-Erling Smørgrav AuthorDate: 2025-09-27 17:06:58 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:23 +0000 tzcode: Drop libc namespace This hasn't been needed in years and is a maintenance headache. MFC after: 1 week Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D52694 (cherry picked from commit d58339f398748b50ff84421e9d81f8f6d94cb949) --- contrib/tzcode/asctime.c | 2 -- contrib/tzcode/difftime.c | 2 -- contrib/tzcode/localtime.c | 52 ++++++++++++++++++++++------------------------ 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/contrib/tzcode/asctime.c b/contrib/tzcode/asctime.c index 1977a2272896..491d23bf73ac 100644 --- a/contrib/tzcode/asctime.c +++ b/contrib/tzcode/asctime.c @@ -14,9 +14,7 @@ /*LINTLIBRARY*/ -#include "namespace.h" #include "private.h" -#include "un-namespace.h" #include enum { STD_ASCTIME_BUF_SIZE = 26 }; diff --git a/contrib/tzcode/difftime.c b/contrib/tzcode/difftime.c index 43af402cdc12..ff78f03c5705 100644 --- a/contrib/tzcode/difftime.c +++ b/contrib/tzcode/difftime.c @@ -7,9 +7,7 @@ /*LINTLIBRARY*/ -#include "namespace.h" #include "private.h" /* for time_t and TYPE_SIGNED */ -#include "un-namespace.h" /* Return -X as a double. Using this avoids casting to 'double'. */ static double diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index a8f97e31a4bb..c98134f7be7c 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -14,7 +14,6 @@ #define LOCALTIME_IMPLEMENTATION #ifdef __FreeBSD__ -#include "namespace.h" #include #endif /* __FreeBSD__ */ #ifdef DETECT_TZ_CHANGES @@ -31,7 +30,6 @@ int __tz_change_interval = DETECT_TZ_CHANGES_INTERVAL; #include #ifdef __FreeBSD__ #include "libc_private.h" -#include "un-namespace.h" #endif /* __FreeBSD__ */ #if HAVE_SYS_STAT_H @@ -45,8 +43,8 @@ int __tz_change_interval = DETECT_TZ_CHANGES_INTERVAL; #if defined THREAD_SAFE && THREAD_SAFE # include #ifdef __FreeBSD__ -# define pthread_mutex_lock(l) (__isthreaded ? _pthread_mutex_lock(l) : 0) -# define pthread_mutex_unlock(l) (__isthreaded ? _pthread_mutex_unlock(l) : 0) +# define pthread_mutex_lock(l) (__isthreaded ? pthread_mutex_lock(l) : 0) +# define pthread_mutex_unlock(l) (__isthreaded ? pthread_mutex_unlock(l) : 0) #endif /* __FreeBSD__ */ static pthread_mutex_t locallock = PTHREAD_MUTEX_INITIALIZER; static int lock(void) { return pthread_mutex_lock(&locallock); } @@ -525,7 +523,7 @@ tzfile_changed(const char *name, int fd) static struct stat old_sb; struct stat sb; - if (_fstat(fd, &sb) != 0) + if (fstat(fd, &sb) != 0) return -1; if (strcmp(name, old_name) != 0) { @@ -668,7 +666,7 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, } #endif } - fid = _open(name, (O_RDONLY | O_BINARY | O_CLOEXEC | O_CLOFORK + fid = open(name, (O_RDONLY | O_BINARY | O_CLOEXEC | O_CLOFORK | O_IGNORE_CTTY | O_NOCTTY)); #else /* __FreeBSD__ */ if ((tzloadflags & TZLOAD_FROMENV) && strcmp(name, TZDEFAULT) == 0) @@ -676,7 +674,7 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, relname = name; if (strncmp(relname, TZDIR "/", strlen(TZDIR) + 1) == 0) relname += strlen(TZDIR) + 1; - dd = _open(TZDIR, O_DIRECTORY | O_RDONLY); + dd = open(TZDIR, O_DIRECTORY | O_RDONLY); if ((tzloadflags & TZLOAD_FROMENV) && issetugid()) { if (dd < 0) return errno; @@ -686,18 +684,18 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, fid = -1; errno = EINVAL; } else { - fid = _openat(dd, relname, O_RDONLY | O_BINARY, AT_RESOLVE_BENEATH); + fid = openat(dd, relname, O_RDONLY | O_BINARY, AT_RESOLVE_BENEATH); } } else { if (dd < 0) { relname = name; dd = AT_FDCWD; } - fid = _openat(dd, relname, O_RDONLY | O_BINARY, 0); + fid = openat(dd, relname, O_RDONLY | O_BINARY, 0); } if (dd != AT_FDCWD && dd >= 0) { serrno = errno; - _close(dd); + close(dd); errno = serrno; } #endif /* __FreeBSD__ */ @@ -714,23 +712,23 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, switch (tzfile_changed(name, fid)) { case -1: serrno = errno; - _close(fid); + close(fid); return serrno; case 0: - _close(fid); + close(fid); return 0; case 1: break; } } #endif /* DETECT_TZ_CHANGES */ - nread = _read(fid, up->buf, sizeof up->buf); + nread = read(fid, up->buf, sizeof up->buf); if (nread < tzheadsize) { int err = nread < 0 ? errno : EINVAL; - _close(fid); + close(fid); return err; } - if (_close(fid) < 0) + if (close(fid) < 0) return errno; for (stored = 4; stored <= 8; stored *= 2) { char version = up->tzhead.tzh_version[0]; @@ -1890,7 +1888,7 @@ localtime_tzset(time_t const *timep, struct tm *tmp, bool setname) static void localtime_key_init(void) { - localtime_key_error = _pthread_key_create(&localtime_key, free); + localtime_key_error = pthread_key_create(&localtime_key, free); } #endif /* __FreeBSD__ */ struct tm * @@ -1903,16 +1901,16 @@ localtime(const time_t *timep) struct tm *p_tm = &tm; if (__isthreaded != 0) { - _pthread_once(&localtime_once, localtime_key_init); + pthread_once(&localtime_once, localtime_key_init); if (localtime_key_error != 0) { errno = localtime_key_error; return (NULL); } - if ((p_tm = _pthread_getspecific(localtime_key)) == NULL) { + if ((p_tm = pthread_getspecific(localtime_key)) == NULL) { if ((p_tm = malloc(sizeof(*p_tm))) == NULL) { return (NULL); } - if (_pthread_setspecific(localtime_key, p_tm) != 0) { + if (pthread_setspecific(localtime_key, p_tm) != 0) { free(p_tm); return (NULL); } @@ -1969,7 +1967,7 @@ gmtime_r(time_t const *restrict timep, struct tm *restrict tmp) static void gmtime_key_init(void) { - gmtime_key_error = _pthread_key_create(&gmtime_key, free); + gmtime_key_error = pthread_key_create(&gmtime_key, free); } #endif /* __FreeBSD__ */ struct tm * @@ -1982,16 +1980,16 @@ gmtime(const time_t *timep) struct tm *p_tm = &tm; if (__isthreaded != 0) { - _pthread_once(&gmtime_once, gmtime_key_init); + pthread_once(&gmtime_once, gmtime_key_init); if (gmtime_key_error != 0) { errno = gmtime_key_error; return (NULL); } - if ((p_tm = _pthread_getspecific(gmtime_key)) == NULL) { + if ((p_tm = pthread_getspecific(gmtime_key)) == NULL) { if ((p_tm = malloc(sizeof(*p_tm))) == NULL) { return (NULL); } - if (_pthread_setspecific(gmtime_key, p_tm) != 0) { + if (pthread_setspecific(gmtime_key, p_tm) != 0) { free(p_tm); return (NULL); } @@ -2017,7 +2015,7 @@ offtime_r(time_t const *restrict timep, long offset, struct tm *restrict tmp) static void offtime_key_init(void) { - offtime_key_error = _pthread_key_create(&offtime_key, free); + offtime_key_error = pthread_key_create(&offtime_key, free); } #endif /* __FreeBSD__ */ struct tm * @@ -2030,16 +2028,16 @@ offtime(time_t const *timep, long offset) struct tm *p_tm = &tm; if (__isthreaded != 0) { - _pthread_once(&offtime_once, offtime_key_init); + pthread_once(&offtime_once, offtime_key_init); if (offtime_key_error != 0) { errno = offtime_key_error; return (NULL); } - if ((p_tm = _pthread_getspecific(offtime_key)) == NULL) { + if ((p_tm = pthread_getspecific(offtime_key)) == NULL) { if ((p_tm = malloc(sizeof(*p_tm))) == NULL) { return (NULL); } - if (_pthread_setspecific(offtime_key, p_tm) != 0) { + if (pthread_setspecific(offtime_key, p_tm) != 0) { free(p_tm); return (NULL); }