]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20050725T0627
authorJakub Jelinek <jakub@redhat.com>
Mon, 25 Jul 2005 06:37:56 +0000 (06:37 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 25 Jul 2005 06:37:56 +0000 (06:37 +0000)
ChangeLog
fedora/branch.mk
posix/Makefile
posix/execvp.c
posix/tst-execvp4.c [new file with mode: 0644]
stdio-common/fxprintf.c
string/test-memset.c
sysdeps/sh/memset.S
wcsmbs/Makefile
wcsmbs/bits/wchar2.h
wcsmbs/tst-wchar-h.c [new file with mode: 0644]

index bff223511616166ea6dda858140f45f8a2aa4c6b..b1b0d1009750873d0145f019d7b7617ccd97faac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+2005-07-24  Ulrich Drepper  <drepper@redhat.com>
+
+       * string/test-memset.c (test_main): Use negative byte value is
+       test.
+
+       * string/test-memset.c (do_one_test): Compare effect of call, not
+       only return value.
+       Add a few casts to avoid warnings.
+
+2005-07-24  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
+
+       * sysdeps/sh/memset.S (memset): Correct 2nd argument handling.
+
+2005-07-24  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1125]
+       * posix/Makefile (tests): Add tst-execvp4.
+       * posix/tst-execvp4.c: New file.
+
+2005-07-24  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1125]
+       * posix/execvp.c (execvp): Change path_malloc to
+       char *, free that pointer on failure.
+
+2005-07-24  Ulrich Drepper  <drepper@redhat.com>
+
+       * wcsmbs/bits/wchar2.h: Use __FILE not FILE.
+       * wcsmbs/Makefile: Add rules to build and run tst-wchar-h.
+       * wcsmbs/tst-wchar-h.c: New file.
+
+2005-07-22  Ulrich Drepper  <drepper@redhat.com>
+
+       * stdio-common/fxprintf.c (__fxprintf): Define variable more local.
+
 2005-07-22  Jakub Jelinek  <jakub@redhat.com>
 
        * wcsmbs/bits/wchar2.h (__vfwprintf_chk, __vwprintf_chk): Use
index 1c1feacc4237c2887dc79586ac9d3286796a3b80..008f73de9a90f371ae191452b4a7f6ab1c95d99a 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-fc4
-fedora-sync-date := 2005-07-22 04:33 UTC
-fedora-sync-tag := fedora-glibc-20050722T0433
+fedora-sync-date := 2005-07-25 06:27 UTC
+fedora-sync-tag := fedora-glibc-20050725T0627
index f6b6aefbe064ab1c46db5b6d545476a04bba401a..cabc1d44d0fc2360635565dd62bf09484ca0dfb6 100644 (file)
@@ -87,7 +87,7 @@ tests         := tstgetopt testfnm runtests runptests      \
                   tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
                   tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
                   tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
-                  tst-execvp3
+                  tst-execvp3 tst-execvp4
 xtests         := bug-ga2
 ifeq (yes,$(build-shared))
 test-srcs      := globtest
index 6f4e4b8566cae138b423b483f167f42ae647090c..8421bd048f73a9d4ba84690a72ef56c7cbebeb2f 100644 (file)
@@ -88,7 +88,7 @@ execvp (file, argv)
   else
     {
       char *path = getenv ("PATH");
-      bool path_malloc = false;
+      char *path_malloc = NULL;
       if (path == NULL)
        {
          /* There is no `PATH' in the environment.
@@ -100,7 +100,7 @@ execvp (file, argv)
            return -1;
          path[0] = ':';
          (void) confstr (_CS_PATH, path + 1, len);
-         path_malloc = true;
+         path_malloc = path;
        }
 
       size_t len = strlen (file) + 1;
@@ -108,8 +108,7 @@ execvp (file, argv)
       char *name = malloc (pathlen + len + 1);
       if (name == NULL)
        {
-         if (path_malloc)
-           free (path);
+         free (path_malloc);
          return -1;
        }
       /* Copy the file name at the top.  */
@@ -190,8 +189,7 @@ execvp (file, argv)
 
       free (script_argv);
       free (name - pathlen);
-      if (path_malloc)
-       free (path);
+      free (path_malloc);
     }
 
   /* Return the error from the last attempt (probably ENOENT).  */
diff --git a/posix/tst-execvp4.c b/posix/tst-execvp4.c
new file mode 100644 (file)
index 0000000..531fab2
--- /dev/null
@@ -0,0 +1,35 @@
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+static int
+do_test (void)
+{
+  char buf[40] = "/usr/bin/does-not-exist";
+  size_t stemlen = strlen (buf);
+  struct stat64 st;
+  int cnt = 0;
+  while (stat64 (buf, &st) != -1 || errno != ENOENT
+        || stat64 (buf + 4, &st) != -1 || errno != ENOENT)
+    {
+      if (cnt++ == 100)
+       {
+         puts ("cannot find a unique file name");
+         return 0;
+       }
+
+      strcpy (buf + stemlen, ".XXXXXX");
+      mktemp (buf);
+    }
+
+  unsetenv ("PATH");
+  char *argv[] = { buf + 9, NULL };
+  execvp (argv[0], argv);
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
index 3b3cc5cddaa432f5dffb859eb7cc663adc47a738..6fecb31fb7a47df14e4605a3c7636fcf51184fcc 100644 (file)
@@ -37,9 +37,9 @@ __fxprintf (FILE *fp, const char *fmt, ...)
   int res;
   if (_IO_fwide (fp, 0) > 0)
     {
-      size_t len = strlen (fmt) + 1, i;
+      size_t len = strlen (fmt) + 1;
       wchar_t wfmt[len];
-      for (i = 0; i < len; ++i)
+      for (size_t i = 0; i < len; ++i)
        {
          assert (isascii (fmt[i]));
          wfmt[i] = fmt[i];
index 9ae774162f55de1d1005c923c775c40723c26716..601ace419534e53d1051d1b59e1e2c75105889b1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure memset functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -49,10 +49,12 @@ static void
 do_one_test (impl_t *impl, char *s, int c, size_t n)
 {
   char *res = CALL (impl, s, c, n);
-  if (res != s)
+  char tstbuf[n];
+  if (res != s
+      || simple_memset (tstbuf, c, n) != tstbuf
+      || memcmp (s, tstbuf, n) != 0)
     {
-      error (0, 0, "Wrong result in function %s %p != %p", impl->name,
-            res, s);
+      error (0, 0, "Wrong result in function %s", impl->name);
       ret = 1;
       return;
     }
@@ -87,7 +89,7 @@ do_test (size_t align, int c, size_t len)
     printf ("Length %4zd, alignment %2zd, c %2d:", len, align, c);
 
   FOR_EACH_IMPL (impl, 0)
-    do_one_test (impl, buf1 + align, c, len);
+    do_one_test (impl, (char *) buf1 + align, c, len);
 
   if (HP_TIMING_AVAIL)
     putchar ('\n');
@@ -143,7 +145,7 @@ do_random_tests (void)
              if (p[i + align] == c)
                p[i + align] = o;
            }
-         res = CALL (impl, p + align, c, len);
+         res = (unsigned char *) CALL (impl, (char *) p + align, c, len);
          if (res != p + align)
            {
              error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd) %p != %p",
@@ -191,7 +193,7 @@ test_main (void)
     printf ("\t%s", impl->name);
   putchar ('\n');
 
-  for (c = 0; c <= 65; c += 65)
+  for (c = -65; c <= 130; c += 65)
     {
       for (i = 0; i < 18; ++i)
        do_test (0, c, 1 << i);
index ca234493670d11d6102e53bf3eb35497ac6463d1..9a8e2efd96ce3c70df3bbe934174cbefdc6723b1 100644 (file)
@@ -28,6 +28,7 @@ ENTRY(memset)
        bt.s    L_byte_loop_init
        mov     r4,r7
 
+       extu.b  r5,r5
        swap.b  r5,r1
        or      r1,r5
        swap.w  r5,r1
index d033de931c10cb619e5d2637b2b92f33ad40fe2b..78b3e5b4e7094f2d83740af6b89c8217d6becabc 100644 (file)
@@ -40,7 +40,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
            wcsmbsload mbsrtowcs_l
 
 tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
-        tst-wcrtomb tst-wcpncpy tst-mbsrtowcs
+        tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h
 
 include ../Rules
 
@@ -62,6 +62,7 @@ CFLAGS-wcstoull_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstod_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstold_l.c = $(strtox-CFLAGS)
 CFLAGS-wcstof_l.c = $(strtox-CFLAGS)
+CFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2
 
 tst-btowc-ENV = LOCPATH=$(common-objpfx)localedata
 tst-mbrtowc-ENV = LOCPATH=$(common-objpfx)localedata
index 29bfad011005efc487caecbdd5afad676d6f49a8..5e6396f048608fce1c6a81342a4fd0de6f4d9cf0 100644 (file)
@@ -230,11 +230,11 @@ vswprintf (wchar_t *__s, size_t __n, __const wchar_t *__format,
 
 #if __USE_FORTIFY_LEVEL > 1
 
-extern int __fwprintf_chk (FILE *__restrict __stream, int __flag,
+extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
                           __const wchar_t *__restrict __format, ...);
 extern int __wprintf_chk (int __flag, __const wchar_t *__restrict __format,
                          ...);
-extern int __vfwprintf_chk (FILE *__restrict __stream, int __flag,
+extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
                            __const wchar_t *__restrict __format,
                            __gnuc_va_list __ap);
 extern int __vwprintf_chk (int __flag, __const wchar_t *__restrict __format,
@@ -252,13 +252,13 @@ extern int __vwprintf_chk (int __flag, __const wchar_t *__restrict __format,
 #endif
 
 extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
-                             FILE *__restrict __stream) __wur;
+                             __FILE *__restrict __stream) __wur;
 extern wchar_t *__REDIRECT (__fgetws_alias,
                            (wchar_t *__restrict __s, int __n,
-                            FILE *__restrict __stream), fgetws) __wur;
+                            __FILE *__restrict __stream), fgetws) __wur;
 
 extern __always_inline __wur wchar_t *
-fgetws (wchar_t *__restrict __s, int __n, FILE *__restrict __stream)
+fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
 {
   if (__bos (__s) != (size_t) -1
       && (!__builtin_constant_p (__n) || (size_t) __n > __bos (__s)))
@@ -268,15 +268,15 @@ fgetws (wchar_t *__restrict __s, int __n, FILE *__restrict __stream)
 
 #ifdef __USE_GNU
 extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
-                                      int __n, FILE *__restrict __stream)
+                                      int __n, __FILE *__restrict __stream)
   __wur;
 extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
                            (wchar_t *__restrict __s, int __n,
-                            FILE *__restrict __stream), fgetws_unlocked)
+                            __FILE *__restrict __stream), fgetws_unlocked)
   __wur;
 
 extern __always_inline __wur wchar_t *
-fgetws_unlocked (wchar_t *__restrict __s, int __n, FILE *__restrict __stream)
+fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
 {
   if (__bos (__s) != (size_t) -1
       && (!__builtin_constant_p (__n) || (size_t) __n > __bos (__s)))
diff --git a/wcsmbs/tst-wchar-h.c b/wcsmbs/tst-wchar-h.c
new file mode 100644 (file)
index 0000000..4cf2dd0
--- /dev/null
@@ -0,0 +1,9 @@
+#include <stdlib.h>
+#include <wchar.h>
+
+int
+main (void)
+{
+  mbstate_t x;
+  return sizeof (x) - sizeof (mbstate_t);
+}