summary refs log tree commit diff
path: root/localedata
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-03-05 12:58:49 -0800
committerRoland McGrath <roland@hack.frob.com>2015-03-05 12:58:49 -0800
commit9162c01d09c327ae2e7c3a5148307e8018792c51 (patch)
tree11b64fb3aedad59ec52f5f775f70d1291c34b872 /localedata
parent209826bcf2e5d1634adf5672e265eec5e5c07e83 (diff)
downloadglibc-9162c01d09c327ae2e7c3a5148307e8018792c51.tar.gz
glibc-9162c01d09c327ae2e7c3a5148307e8018792c51.tar.xz
glibc-9162c01d09c327ae2e7c3a5148307e8018792c51.zip
Avoid re-exec-self in bug-setlocale1.
Diffstat (limited to 'localedata')
-rw-r--r--localedata/ChangeLog11
-rw-r--r--localedata/Makefile4
-rw-r--r--localedata/bug-setlocale1.c40
3 files changed, 15 insertions, 40 deletions
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index ceb373f1be..61857f57a2 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,14 @@
+2015-03-04  Roland McGrath  <roland@hack.frob.com>
+
+	* bug-setlocale1.c (do_test): Remove argument handling and
+	self-exec'ing logic.  Just expect to be run with the right
+	variables (and nothing else) directly in the environment instead.
+	(TEST_FUNCTION): Don't pass arguments to do_test.
+	* Makefile (bug-setlocale1-ARGS, bug-setlocale1-static-ARGS):
+	Variables removed.
+	(bug-setlocale1-ENV-only, bug-setlocale1-static-ENV-only):
+	New variables.
+
 2015-02-23  Alexandre Oliva <aoliva@redhat.com>
 
 	* unicode-gen/ctype_compatibility.py: Use date ranges in
diff --git a/localedata/Makefile b/localedata/Makefile
index d1218f5784..0f67725800 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -237,8 +237,8 @@ $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \
 	$(evaluate-test)
 
-bug-setlocale1-ARGS = -- $(host-test-program-cmd)
-bug-setlocale1-static-ARGS = $(bug-setlocale1-ARGS)
+bug-setlocale1-ENV-only = LOCPATH=$(objpfx) LC_CTYPE=de_DE.UTF-8
+bug-setlocale1-static-ENV-only = $(bug-setlocale1-ENV-only)
 
 $(objdir)/iconvdata/gconv-modules:
 	$(MAKE) -C ../iconvdata subdir=iconvdata $@
diff --git a/localedata/bug-setlocale1.c b/localedata/bug-setlocale1.c
index dc7f6f3f08..546ea7beb8 100644
--- a/localedata/bug-setlocale1.c
+++ b/localedata/bug-setlocale1.c
@@ -7,44 +7,8 @@
 
 
 static int
-do_test (int argc, char *argv[])
+do_test (void)
 {
-  if (argc > 1)
-    {
-      char *newargv[5];
-      int i;
-      if (argc != 2 && argc != 5)
-	{
-	  printf ("wrong number of arguments (%d)\n", argc);
-	  return 1;
-	}
-
-      for (i = 0; i < (argc == 5 ? 4 : 1); i++)
-	newargv[i] = argv[i + 1];
-      newargv[i] = NULL;
-
-      char *env[3];
-      env[0] = (char *) "LC_CTYPE=de_DE.UTF-8";
-      char *loc = getenv ("LOCPATH");
-      if (loc == NULL || loc[0] == '\0')
-	{
-	  puts ("LOCPATH not set");
-	  return 1;
-	}
-      asprintf (&env[1], "LOCPATH=%s", loc);
-      if (env[1] == NULL)
-	{
-	  puts ("asprintf failed");
-	  return 1;
-	}
-      env[2] = NULL;
-
-      execve (newargv[0], newargv, env);
-
-      puts ("execve returned");
-      return 1;
-    }
-
   int result = 0;
 
   char *a = setlocale (LC_ALL, "");
@@ -128,5 +92,5 @@ do_test (int argc, char *argv[])
   return result;
 }
 
-#define TEST_FUNCTION do_test (argc, argv)
+#define TEST_FUNCTION do_test ()
 #include "../test-skeleton.c"