]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
copy.c: Remove definitions of factored-out functions.
authorJim Meyering <jim@meyering.net>
Mon, 24 Sep 2007 13:09:17 +0000 (15:09 +0200)
committerJim Meyering <jim@meyering.net>
Mon, 24 Sep 2007 13:09:26 +0000 (15:09 +0200)
* src/copy.c: Include "file-set.h".
(seen_file, record_file): Remove functions that I factored
out on 2007-08-23.

ChangeLog
src/copy.c

index be7b73cd4ccc150e8c2e4bb969eaba8c4a9ab60f..6b31a4f1f141d451638ee1317f50edcca1aacac0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-24  Jim Meyering  <jim@meyering.net>
+
+       copy.c: Remove definitions of factored-out functions.
+       * src/copy.c: Include "file-set.h".
+       (seen_file, record_file): Remove functions that I factored
+       out on 2007-08-23.
+
 2007-09-22  Jim Meyering  <jim@meyering.net>
 
        Don't print the commands of a 10-line script that's run in each subdir.
index 92588bf14683ff5bfad27feb1061ad5966c2070e..331fef87165131deefe6d8e69ba160e78b9ab030 100644 (file)
@@ -39,6 +39,7 @@
 #include "euidaccess.h"
 #include "error.h"
 #include "fcntl--.h"
+#include "file-set.h"
 #include "filemode.h"
 #include "filenamecat.h"
 #include "full-write.h"
@@ -931,71 +932,6 @@ src_info_init (struct cp_options *x)
                       triple_free);
 }
 
-/* Return true if there is an entry in hash table, HT,
-   for the file described by FILE and STATS.  */
-static bool
-seen_file (Hash_table const *ht, char const *file,
-          struct stat const *stats)
-{
-  struct F_triple new_ent;
-
-  if (ht == NULL)
-    return false;
-
-  new_ent.name = (char *) file;
-  new_ent.st_ino = stats->st_ino;
-  new_ent.st_dev = stats->st_dev;
-
-  return !!hash_lookup (ht, &new_ent);
-}
-
-/* Record destination file, FILE, and dev/ino from *STATS,
-   in the hash table, HT.  If HT is NULL, return immediately.
-   If STATS is NULL, call lstat on FILE to get the device
-   and inode numbers.  If that lstat fails, simply return.
-   If memory allocation fails, exit immediately.  */
-static void
-record_file (Hash_table *ht, char const *file,
-            struct stat const *stats)
-{
-  struct F_triple *ent;
-
-  if (ht == NULL)
-    return;
-
-  ent = xmalloc (sizeof *ent);
-  ent->name = xstrdup (file);
-  if (stats)
-    {
-      ent->st_ino = stats->st_ino;
-      ent->st_dev = stats->st_dev;
-    }
-  else
-    {
-      struct stat sb;
-      if (lstat (file, &sb) != 0)
-       return;
-      ent->st_ino = sb.st_ino;
-      ent->st_dev = sb.st_dev;
-    }
-
-  {
-    struct F_triple *ent_from_table = hash_insert (ht, ent);
-    if (ent_from_table == NULL)
-      {
-       /* Insertion failed due to lack of memory.  */
-       xalloc_die ();
-      }
-
-    if (ent_from_table != ent)
-      {
-       /* There was alread a matching entry in the table, so ENT was
-          not inserted.  Free it.  */
-       triple_free (ent);
-      }
-  }
-}
-
 /* When effecting a move (e.g., for mv(1)), and given the name DST_NAME
    of the destination and a corresponding stat buffer, DST_SB, return
    true if the logical `move' operation should _not_ proceed.