From nobody Mon Jun 12 12:22:28 2023 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 4QfrRT0Vlrz4d9lK; Mon, 12 Jun 2023 12:22:29 +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 4QfrRS4qw3z3qmx; Mon, 12 Jun 2023 12:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686572548; 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=/Em2mEdXfbj7ppQxxdA9K2vPPNWcGCwSn3ffNwd1q6A=; b=NrG5vFKEuZYb1yA0zUKaVfGK22LiJRlIq0Jqvblg4RI5U5fIMgB4rRaYD6zaXlrHFbCSIX GbNNz6SyZVxjTm6DhqYIQCc3fJLvbHU3TQQwBoC5n2WvzKIRCM9ysAFZMv9+A7Ek1cPX6q AJx1P1AzTICZBli6BV7xBsdalzbzZOlJ8X3HMeybfMES5IwhUxY4PVDAWWIcObb8bo45Bo m0O7IXn6bWV0OCzf0m1sWSSUOWykcUAEsXtb/jrBA9tbpQoSAHVGmItV+t5W6APUjIht3g sgT++f1ZssS3Q4VYMrvlghM+IM5umCkTfONPt4EM9YQDkykQiauCPFS/S2UfEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686572548; 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=/Em2mEdXfbj7ppQxxdA9K2vPPNWcGCwSn3ffNwd1q6A=; b=l55DMJkj6RplwlHJt//ELiBV9KO8MSpjgzhr3BlEIUJBz+uWvK1XOohMI1V2t0QlvA5YhR YQbI4zFoROg0wUStbd9umUonVoKHsRBP3le0EXzlGB5XJVOkHVxD93B6CVpqwnYjmH2VxI Jreu0eVope6twCmm0VpV7p19indv3mz33ltfnka/Iqlb4Kkli/9gEP5llUd0X4c95A3JmE c8Z+0otwJR0nyx/70K+hoIKzjjI7YurJbiPtDiIT+9nLRveUviF+gcpEcYqD3RhqalxosQ C0quqLItida4dgKKD+c8hFx4KnHhATlmw4Pgcv0TSpNhw9v9KMih6LwKNK7W8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686572548; a=rsa-sha256; cv=none; b=LGdDi2wpC5wz2OfJBUj+Hl3371T1SfELTAddyvrvrH1fU14ltFvrHYPai45KhsvmBrT6x3 y2FKj+zfGB/o5M4ggCiga8FxNHJGYPM922oZaIvFLBkx8GKOY6E06e1aolLkaPRg58roXi VXJrviVWvVCtagoIgk6+h8n6mvjHNE1zP3SE5Oj8Mr3ZJjAkzlFtcpn+RH8gZgh5rEEypO 2wYwiEC2h6h7ZoBjvLhqFfW+MjjY8NMqa6nqIUfECGCXOy9WS6Xy9b8fiiPcYIY9GMIfCV MNgTKDlNnqOCRj7rOBVP8JQJ2yNc7Y13HSg1CaYkFdz5ZO8o8rhc5tq5oS0OhQ== 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 4QfrRS3klzzfQp; Mon, 12 Jun 2023 12:22:28 +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 35CCMSwj048060; Mon, 12 Jun 2023 12:22:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35CCMSje048059; Mon, 12 Jun 2023 12:22:28 GMT (envelope-from git) Date: Mon, 12 Jun 2023 12:22:28 GMT Message-Id: <202306121222.35CCMSje048059@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: 750a1522f6ac - stable/13 - libc: move declaration of 'char **environ' to common private header 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: 750a1522f6acf9bb51eed67d350f9f730b647ad5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=750a1522f6acf9bb51eed67d350f9f730b647ad5 commit 750a1522f6acf9bb51eed67d350f9f730b647ad5 Author: Konstantin Belousov AuthorDate: 2022-11-06 04:08:36 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-12 12:19:38 +0000 libc: move declaration of 'char **environ' to common private header (cherry picked from commit 0c6f0c0db75ea5a1e89a68a163fc555bdd7d00f5) --- lib/libc/csu/ignore_init.c | 2 -- lib/libc/gen/auxv.c | 1 - lib/libc/gen/exec.c | 2 -- lib/libc/gen/popen.c | 2 -- lib/libc/gen/posix_spawn.c | 2 -- lib/libc/gen/tls.c | 2 -- lib/libc/include/libc_private.h | 2 ++ lib/libc/stdlib/getenv.c | 3 +-- 8 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/libc/csu/ignore_init.c b/lib/libc/csu/ignore_init.c index 60c45d7e735f..346409e3f370 100644 --- a/lib/libc/csu/ignore_init.c +++ b/lib/libc/csu/ignore_init.c @@ -117,8 +117,6 @@ handle_static_init(int argc, char **argv, char **env) } } -extern char **environ; - static void handle_argv(int argc, char *argv[], char **env) { diff --git a/lib/libc/gen/auxv.c b/lib/libc/gen/auxv.c index 2f043f8814cf..29b3d6929144 100644 --- a/lib/libc/gen/auxv.c +++ b/lib/libc/gen/auxv.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; extern int _DYNAMIC; #pragma weak _DYNAMIC diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 2c703bb4e73e..f1d69e147719 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; - static const char execvPe_err_preamble[] = "execvP: "; static const char execvPe_err_trailer[] = ": path too long\n"; diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index c5373077f3ae..f0b1a61c2803 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; - struct pid { SLIST_ENTRY(pid) next; FILE *fp; diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c index 909db9a60a02..7dc0ade5b309 100644 --- a/lib/libc/gen/posix_spawn.c +++ b/lib/libc/gen/posix_spawn.c @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; - struct __posix_spawnattr { short sa_flags; pid_t sa_pgroup; diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index d75b883b68db..74b2ae562c99 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -401,8 +401,6 @@ __libc_free_tls(void *tcb __unused, size_t tcbsize __unused, #endif /* PIC */ -extern char **environ; - void _init_tls(void) { diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 5fa7a6da1198..991624557118 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -39,6 +39,8 @@ #include #include +extern char **environ; + /* * The kernel doesn't expose PID_MAX to the user space. Save it here * to allow to run a newer world on a pre-1400079 kernel. diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c index 4c71801b242f..a413e8d7d93f 100644 --- a/lib/libc/stdlib/getenv.c +++ b/lib/libc/stdlib/getenv.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" - +#include "libc_private.h" static const char CorruptEnvFindMsg[] = "environment corrupt; unable to find "; static const char CorruptEnvValueMsg[] = @@ -56,7 +56,6 @@ static const char CorruptEnvValueMsg[] = * intEnviron: Internally-built environ. Exposed via environ during * (re)builds of the environment. */ -extern char **environ; static char **origEnviron; static char **intEnviron = NULL; static int environSize = 0;