bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sync from gnulib


From: Paul Eggert
Subject: sync from gnulib
Date: Mon, 09 Aug 2004 22:44:04 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I installed this to keep up with today's gnulib fixes.

Index: lib/ChangeLog
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/ChangeLog,v
retrieving revision 1.812
diff -p -u -r1.812 ChangeLog
--- lib/ChangeLog       9 Aug 2004 23:35:26 -0000       1.812
+++ lib/ChangeLog       10 Aug 2004 05:40:41 -0000
@@ -1,5 +1,16 @@
 2004-08-09  Paul Eggert  <address@hidden>
 
+       * Makefile.am (libfetish_a_SOURCES): Add getpass.h.
+       * getpass.h: New file.
+       * .cpp-disable: Add it.
+       * getpass.c [!_LIBC]: Include it.
+
+       * obstack.h (obstack_empty_p):
+       Don't assume that chunk->contents is suitably aligned.
+       * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
+       Likewise. Problem reported by Benno in
+       <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
+
        * chown.c (rpl_chown): Work even if the file is writeable but not
        readable.  This could be improved further but it'd take some work.
        * fts.c (diropen): New function.
Index: lib/Makefile.am
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/Makefile.am,v
retrieving revision 1.193
diff -p -u -r1.193 Makefile.am
--- lib/Makefile.am     9 Aug 2004 18:44:50 -0000       1.193
+++ lib/Makefile.am     10 Aug 2004 03:55:27 -0000
@@ -66,6 +66,7 @@ libfetish_a_SOURCES = \
   full-write.c full-write.h \
   getline.h \
   getpagesize.h \
+  getpass.h \
   gettime.c \
   gettext.h \
   getugroups.c \
Index: lib/getpass.c
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/getpass.c,v
retrieving revision 1.5
diff -p -u -r1.5 getpass.c
--- lib/getpass.c       17 Oct 2003 08:26:58 -0000      1.5
+++ lib/getpass.c       10 Aug 2004 03:54:36 -0000
@@ -19,6 +19,10 @@
 # include <config.h>
 #endif
 
+#if !_LIBC
+# include "getpass.h"
+#endif
+
 #if _LIBC
 # define HAVE_STDIO_EXT_H 1
 #endif
Index: lib/obstack.c
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/obstack.c,v
retrieving revision 1.26
diff -p -u -r1.26 obstack.c
--- lib/obstack.c       21 May 2004 06:41:51 -0000      1.26
+++ lib/obstack.c       10 Aug 2004 05:11:50 -0000
@@ -173,7 +173,8 @@ _obstack_begin (struct obstack *h,
   chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
   if (!chunk)
     (*obstack_alloc_failed_handler) ();
-  h->next_free = h->object_base = chunk->contents;
+  h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
+                                              alignment - 1);
   h->chunk_limit = chunk->limit
     = (char *) chunk + h->chunk_size;
   chunk->prev = 0;
@@ -220,7 +221,8 @@ _obstack_begin_1 (struct obstack *h, int
   chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
   if (!chunk)
     (*obstack_alloc_failed_handler) ();
-  h->next_free = h->object_base = chunk->contents;
+  h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
+                                              alignment - 1);
   h->chunk_limit = chunk->limit
     = (char *) chunk + h->chunk_size;
   chunk->prev = 0;
@@ -287,7 +289,10 @@ _obstack_newchunk (struct obstack *h, in
   /* If the object just copied was the only data in OLD_CHUNK,
      free that chunk and remove it from the chain.
      But not if that chunk might contain an empty object.  */
-  if (h->object_base == old_chunk->contents && ! h->maybe_empty_object)
+  if (! h->maybe_empty_object
+      && (h->object_base
+         == __PTR_ALIGN ((char *) old_chunk, old_chunk->contents,
+                         h->alignment_mask)))
     {
       new_chunk->prev = old_chunk->prev;
       CALL_FREEFUN (h, old_chunk);
Index: lib/obstack.h
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/obstack.h,v
retrieving revision 1.29
diff -p -u -r1.29 obstack.h
--- lib/obstack.h       5 Aug 2004 23:01:05 -0000       1.29
+++ lib/obstack.h       10 Aug 2004 05:07:25 -0000
@@ -287,7 +287,10 @@ __extension__                                              
                \
 # define obstack_empty_p(OBSTACK)                                      \
   __extension__                                                                
\
   ({ struct obstack const *__o = (OBSTACK);                            \
-     (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
+     (__o->chunk->prev == 0                                            \
+      && __o->next_free == __PTR_ALIGN ((char *) __o->chunk,           \
+                                       __o->chunk->contents,           \
+                                       __o->alignment_mask)); })
 
 # define obstack_grow(OBSTACK,where,length)                            \
 __extension__                                                          \
@@ -411,7 +414,10 @@ __extension__                                              
                \
  (unsigned) ((h)->chunk_limit - (h)->next_free)
 
 # define obstack_empty_p(h) \
- ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
+ ((h)->chunk->prev == 0                                                        
\
+  && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk,               \
+                                   (h)->chunk->contents,               \
+                                   (h)->alignment_mask))
 
 /* Note that the call to _obstack_newchunk is enclosed in (..., 0)
    so that we can avoid having void expressions
Index: m4/ChangeLog
===================================================================
RCS file: /home/eggert/coreutils/cu/m4/ChangeLog,v
retrieving revision 1.603
diff -p -u -r1.603 ChangeLog
--- m4/ChangeLog        9 Aug 2004 18:16:24 -0000       1.603
+++ m4/ChangeLog        10 Aug 2004 05:30:52 -0000
@@ -3,6 +3,11 @@
        * sha1.m4: Renamed from sha.m4.
        (gl_SHA1): Renamed from gl_SHA.  All uses changed.
 
+2004-08-08  Simon Josefsson  <address@hidden>
+
+       * getpass.m4 (gl_FUNC_GETPASS, gl_FUNC_GETPASS_GNU):
+       Check getpass declaration.
+
 2004-08-07  Paul Eggert  <address@hidden>
 
        * canonicalize.m4, getcwd-path-max.m4, strdup.m4: Merge from gnulib.
Index: m4/fnmatch.m4
===================================================================
RCS file: /home/eggert/coreutils/cu/m4/fnmatch.m4,v
retrieving revision 1.16
diff -p -u -r1.16 fnmatch.m4
--- m4/fnmatch.m4       9 Aug 2004 23:27:55 -0000       1.16
+++ m4/fnmatch.m4       10 Aug 2004 03:41:30 -0000
@@ -28,10 +28,10 @@ AC_DEFUN([_AC_FUNC_FNMATCH_IF],
 [AC_CACHE_CHECK(
    [for working $1 fnmatch],
    [$2],
-  [# Some versions of Solaris, SCO, and the GNU C Library
-   # have a broken or incompatible fnmatch.
-   # So we run a test program.  If we are cross-compiling, take no chance.
-   # Thanks to John Oleynick, Fran├žois Pinard, and Paul Eggert for this test.
+  [dnl Some versions of Solaris, SCO, and the GNU C Library
+   dnl have a broken or incompatible fnmatch.
+   dnl So we run a test program.  If we are cross-compiling, take no chance.
+   dnl Thanks to John Oleynick, Fran├žois Pinard, and Paul Eggert for this test.
    AC_RUN_IFELSE(
       [AC_LANG_PROGRAM(
         [
Index: m4/getpass.m4
===================================================================
RCS file: /home/eggert/coreutils/cu/m4/getpass.m4,v
retrieving revision 1.2
diff -p -u -r1.2 getpass.m4
--- m4/getpass.m4       16 Jan 2004 08:29:54 -0000      1.2
+++ m4/getpass.m4       10 Aug 2004 03:56:12 -0000
@@ -1,4 +1,4 @@
-# getpass.m4 serial 3
+# getpass.m4 serial 4
 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -10,6 +10,7 @@ dnl the same distribution terms as the r
 AC_DEFUN([gl_FUNC_GETPASS],
 [
   AC_REPLACE_FUNCS(getpass)
+  AC_CHECK_DECLS_ONCE(getpass)
   if test $ac_cv_func_getpass = no; then
     gl_PREREQ_GETPASS
   fi
@@ -19,6 +20,7 @@ AC_DEFUN([gl_FUNC_GETPASS],
 # arbitrary length (not just 8 bytes as on HP-UX).
 AC_DEFUN([gl_FUNC_GETPASS_GNU],
 [
+  AC_CHECK_DECLS_ONCE(getpass)
   dnl TODO: Detect when GNU getpass() is already found in glibc.
   AC_LIBOBJ(getpass)
   gl_PREREQ_GETPASS
--- /dev/null   2003-03-18 13:55:57 -0800
+++ lib/getpass.h       2004-08-09 22:42:36 -0700
@@ -0,0 +1,31 @@
+/* getpass.h -- Read a password of arbitrary length from /dev/tty or stdin.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   Contributed by Simon Josefsson <address@hidden>, 2004.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef GETPASS_H
+# define GETPASS_H
+
+/* Get getpass declaration, if available.  */
+# include <unistd.h>
+
+# if defined HAVE_DECL_GETPASS && !HAVE_DECL_GETPASS
+/* Read a password of arbitrary length from /dev/tty or stdin.  */
+char *getpass (const char *prompt);
+
+# endif
+
+#endif /* GETPASS_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]