svn commit: r245777 - in stable/9/lib/csu: amd64 arm i386-elf mips powerpc powerpc64 sparc64

Konstantin Belousov kib at FreeBSD.org
Tue Jan 22 07:32:28 UTC 2013


Author: kib
Date: Tue Jan 22 07:32:26 2013
New Revision: 245777
URL: http://svnweb.freebsd.org/changeset/base/245777

Log:
  MFC r245133:
  Only assign the environ in the startup code when environ is NULL.
  
  Note that this is not the merge, but a reimplementation of the fix,
  done for the not-consolidated code in the stable/9.

Modified:
  stable/9/lib/csu/amd64/crt1.c
  stable/9/lib/csu/arm/crt1.c
  stable/9/lib/csu/i386-elf/crt1_c.c
  stable/9/lib/csu/mips/crt1.c
  stable/9/lib/csu/powerpc/crt1.c
  stable/9/lib/csu/powerpc64/crt1.c
  stable/9/lib/csu/sparc64/crt1.c
Directory Properties:
  stable/9/lib/csu/   (props changed)

Modified: stable/9/lib/csu/amd64/crt1.c
==============================================================================
--- stable/9/lib/csu/amd64/crt1.c	Tue Jan 22 07:22:58 2013	(r245776)
+++ stable/9/lib/csu/amd64/crt1.c	Tue Jan 22 07:32:26 2013	(r245777)
@@ -71,7 +71,8 @@ _start(char **ap, void (*cleanup)(void))
 	argc = *(long *)(void *)ap;
 	argv = ap + 1;
 	env = ap + 2 + argc;
-	environ = env;
+	if (environ == NULL)
+		environ = env;
 	if (argc > 0 && argv[0] != NULL) {
 		__progname = argv[0];
 		for (s = __progname; *s != '\0'; s++)

Modified: stable/9/lib/csu/arm/crt1.c
==============================================================================
--- stable/9/lib/csu/arm/crt1.c	Tue Jan 22 07:22:58 2013	(r245776)
+++ stable/9/lib/csu/arm/crt1.c	Tue Jan 22 07:32:26 2013	(r245777)
@@ -106,7 +106,8 @@ __start(int argc, char **argv, char **en
 {
 	const char *s;
 
-	environ = env;
+	if (environ == NULL)
+		environ = env;
 
 	if (argc > 0 && argv[0] != NULL) {
 		__progname = argv[0];

Modified: stable/9/lib/csu/i386-elf/crt1_c.c
==============================================================================
--- stable/9/lib/csu/i386-elf/crt1_c.c	Tue Jan 22 07:22:58 2013	(r245776)
+++ stable/9/lib/csu/i386-elf/crt1_c.c	Tue Jan 22 07:32:26 2013	(r245777)
@@ -70,7 +70,8 @@ _start1(fptr cleanup, int argc, char *ar
 	const char *s;
 
 	env = argv + argc + 1;
-	environ = env;
+	if (environ == NULL)
+		environ = env;
 	if (argc > 0 && argv[0] != NULL) {
 		__progname = argv[0];
 		for (s = __progname; *s != '\0'; s++)

Modified: stable/9/lib/csu/mips/crt1.c
==============================================================================
--- stable/9/lib/csu/mips/crt1.c	Tue Jan 22 07:22:58 2013	(r245776)
+++ stable/9/lib/csu/mips/crt1.c	Tue Jan 22 07:32:26 2013	(r245777)
@@ -82,7 +82,8 @@ __start(char **ap,
 	argc = * (long *) ap;
 	argv = ap + 1;
 	env  = ap + 2 + argc;
-	environ = env;
+	if (environ == NULL)
+		environ = env;
 	if (argc > 0 && argv[0] != NULL) {
 		const char *s;
 		__progname = argv[0];

Modified: stable/9/lib/csu/powerpc/crt1.c
==============================================================================
--- stable/9/lib/csu/powerpc/crt1.c	Tue Jan 22 07:22:58 2013	(r245776)
+++ stable/9/lib/csu/powerpc/crt1.c	Tue Jan 22 07:32:26 2013	(r245777)
@@ -90,7 +90,8 @@ _start(int argc, char **argv, char **env
 {
 	const char *s;
 
-	environ = env;
+	if (environ == NULL)
+		environ = env;
 
 	if (argc > 0 && argv[0] != NULL) {
 		__progname = argv[0];

Modified: stable/9/lib/csu/powerpc64/crt1.c
==============================================================================
--- stable/9/lib/csu/powerpc64/crt1.c	Tue Jan 22 07:22:58 2013	(r245776)
+++ stable/9/lib/csu/powerpc64/crt1.c	Tue Jan 22 07:32:26 2013	(r245777)
@@ -89,7 +89,8 @@ _start(int argc, char **argv, char **env
 {
 	const char *s;
 
-	environ = env;
+	if (environ == NULL)
+		environ = env;
 
 	if (argc > 0 && argv[0] != NULL) {
 		__progname = argv[0];

Modified: stable/9/lib/csu/sparc64/crt1.c
==============================================================================
--- stable/9/lib/csu/sparc64/crt1.c	Tue Jan 22 07:22:58 2013	(r245776)
+++ stable/9/lib/csu/sparc64/crt1.c	Tue Jan 22 07:32:26 2013	(r245777)
@@ -94,7 +94,8 @@ _start(char **ap, void (*cleanup)(void),
 	argc = *(long *)(void *)ap;
 	argv = ap + 1;
 	env  = ap + 2 + argc;
-	environ = env;
+	if (environ == NULL)
+		environ = env;
 	if (argc > 0 && argv[0] != NULL) {
 		__progname = argv[0];
 		for (s = __progname; *s != '\0'; s++)


More information about the svn-src-stable-9 mailing list