]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
authorJim Meyering <jim@meyering.net>
Mon, 18 Jun 2007 09:17:30 +0000 (11:17 +0200)
committerJim Meyering <jim@meyering.net>
Mon, 18 Jun 2007 13:19:34 +0000 (15:19 +0200)
* bootstrap.conf (gnulib_modules): Add readlink-with-size.
Remove xreadlink and xreadlink-with-size.
* src/copy.c (copy_internal): Use mreadlink_with_size,
not xreadlink_with_size.
* src/ls.c (get_link_name): Likewise.
* src/readlink.c (main): Likewise.
* src/stat.c (print_stat): Likewise.

ChangeLog
bootstrap.conf
lib/.cvsignore
lib/.gitignore
src/copy.c
src/ls.c
src/readlink.c
src/stat.c

index c0f0adb713449de6c63e46dcad1e28f5249494c7..ddeedf61500454cdacf80e3e868bdec5e676f126 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-06-18  Jim Meyering  <jim@meyering.net>
 
+       Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
+       * bootstrap.conf (gnulib_modules): Add readlink-with-size.
+       Remove xreadlink and xreadlink-with-size.
+       * src/copy.c (copy_internal): Use mreadlink_with_size,
+       not xreadlink_with_size.
+       * src/ls.c (get_link_name): Likewise.
+       * src/readlink.c (main): Likewise.
+       * src/stat.c (print_stat): Likewise.
+
        * README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out.
 
 2007-06-16  Jim Meyering  <jim@meyering.net>
index 11d429bd6c95649b0977609dfcb85ae0dc96e5db..9d2d67b5351ad49d6db626cb0fa605cafc3b1e20 100644 (file)
@@ -62,7 +62,8 @@ gnulib_modules="
        long-options lstat malloc mbswidth memcasecmp mempcpy
        memrchr mkancesdirs mkdir mkdir-p mkstemp mktime modechange
        mountlist mpsort obstack pathmax perl physmem posixtm posixver putenv
-       quote quotearg raise readlink readtokens readtokens0 readutmp
+       quote quotearg raise readlink mreadlink-with-size readtokens
+       readtokens0 readutmp
        realloc regex rename-dest-slash rmdir rmdir-errno
        root-dev-ino
        rpmatch
@@ -76,7 +77,7 @@ gnulib_modules="
        uptime userspec utimecmp utimens vasprintf verify version-etc-fsf
        wcwidth winsz-ioctl winsz-termios write-any-file
        xalloc xgetcwd xgethostname
-       xmemcoll xnanosleep xreadlink xreadlink-with-size xstrtod xstrtoimax
+       xmemcoll xnanosleep xstrtod xstrtoimax
        xstrtol xstrtold xstrtoumax yesno
 "
 
index 0a52cbb6ae985ce6139a8200f8117d587ef63c1b..ea040c3b93c81d7a907a4a3ea3ad86252cda4d39 100644 (file)
@@ -234,6 +234,8 @@ mountlist.c
 mountlist.h
 mpsort.c
 mpsort.h
+mreadlink-with-size.c
+mreadlink.h
 nanosleep.c
 netinet_in.h
 netinet_in_.h
@@ -424,9 +426,6 @@ xmemcoll.c
 xmemcoll.h
 xnanosleep.c
 xnanosleep.h
-xreadlink-with-size.c
-xreadlink.c
-xreadlink.h
 xsize.h
 xstrndup.c
 xstrndup.h
index 2d4209f32b18b2589a56ccbb7e36d411c23f2111..ae7ef06e8b71ca873edc7afac6d64bfb24f073d9 100644 (file)
@@ -228,6 +228,8 @@ mountlist.c
 mountlist.h
 mpsort.c
 mpsort.h
+mreadlink-with-size.c
+mreadlink.h
 nanosleep.c
 netinet_in.h
 netinet_in_.h
@@ -415,9 +417,6 @@ xmemcoll.c
 xmemcoll.h
 xnanosleep.c
 xnanosleep.h
-xreadlink-with-size.c
-xreadlink.c
-xreadlink.h
 xsize.h
 xstrndup.c
 xstrndup.h
index 0e9f2d791da6c901c3466c04aa90ebb5cd7b3a42..fd05190962bb3dbfb314b9d3aac0d84a2a896c1b 100644 (file)
@@ -54,7 +54,7 @@
 #include "utimecmp.h"
 #include "utimens.h"
 #include "write-any-file.h"
-#include "xreadlink.h"
+#include "mreadlink.h"
 #include "yesno.h"
 
 #ifndef HAVE_FCHOWN
@@ -1863,7 +1863,7 @@ copy_internal (char const *src_name, char const *dst_name,
     }
   else if (S_ISLNK (src_mode))
     {
-      char *src_link_val = xreadlink_with_size (src_name, src_sb.st_size);
+      char *src_link_val = mreadlink_with_size (src_name, src_sb.st_size);
       if (src_link_val == NULL)
        {
          error (0, errno, _("cannot read symbolic link %s"), quote (src_name));
@@ -1884,8 +1884,8 @@ copy_internal (char const *src_name, char const *dst_name,
                 in some cases, e.g., if the destination symlink has the
                 wrong ownership, permissions, or time stamps.  */
              char *dest_link_val =
-               xreadlink_with_size (dst_name, dst_sb.st_size);
-             if (STREQ (dest_link_val, src_link_val))
+               mreadlink_with_size (dst_name, dst_sb.st_size);
+             if (dest_link_val && STREQ (dest_link_val, src_link_val))
                same_link = true;
              free (dest_link_val);
            }
index c0e332b3b2a1bf4f6eac8f59d99f4e5414a91d1c..c4cca845f09cf60b8900ab10365caaaa971523f5 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
 #include "strverscmp.h"
 #include "wcwidth.h"
 #include "xstrtol.h"
-#include "xreadlink.h"
+#include "mreadlink.h"
 
 #define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \
                      : (ls_mode == LS_MULTI_COL \
@@ -2837,7 +2837,7 @@ is_directory (const struct fileinfo *f)
 static void
 get_link_name (char const *filename, struct fileinfo *f, bool command_line_arg)
 {
-  f->linkname = xreadlink_with_size (filename, f->stat.st_size);
+  f->linkname = mreadlink_with_size (filename, f->stat.st_size);
   if (f->linkname == NULL)
     file_failure (command_line_arg, _("cannot read symbolic link %s"),
                  filename);
index 0961d235c2f08c53bbf7c4763cac5806db95c3ac..4a410bb00c92e79377bfa2966e5d88f7e38fbdaf 100644 (file)
@@ -1,5 +1,5 @@
 /* readlink -- display value of a symbolic link.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002-2007 Free Software Foundation, Inc.
 
    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
@@ -25,7 +25,7 @@
 #include "system.h"
 #include "canonicalize.h"
 #include "error.h"
-#include "xreadlink.h"
+#include "mreadlink.h"
 #include "quote.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
@@ -159,7 +159,7 @@ main (int argc, char **argv)
 
   value = (can_mode != -1
           ? canonicalize_filename_mode (fname, can_mode)
-          : xreadlink (fname));
+          : mreadlink_with_size (fname, 63));
   if (value)
     {
       printf ("%s%s", value, (no_newline ? "" : "\n"));
index b8cbbf58f8a7a6922f4a950ad869af6378d94290..57439a47202e684d867adfcc1522601389c505ba 100644 (file)
@@ -68,7 +68,7 @@
 #include "quotearg.h"
 #include "stat-time.h"
 #include "strftime.h"
-#include "xreadlink.h"
+#include "mreadlink.h"
 
 #define alignof(type) offsetof (struct { char c; type x; }, x)
 
@@ -524,7 +524,7 @@ print_stat (char *pformat, size_t prefix_len, char m,
       out_string (pformat, prefix_len, quote (filename));
       if (S_ISLNK (statbuf->st_mode))
        {
-         char *linkname = xreadlink_with_size (filename, statbuf->st_size);
+         char *linkname = mreadlink_with_size (filename, statbuf->st_size);
          if (linkname == NULL)
            {
              error (0, errno, _("cannot read symbolic link %s"),