diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-01-20 10:55:18 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-01-20 10:55:18 +0000 |
commit | 70e9163c9c18e995515598085cb824e554eb7ae7 (patch) | |
tree | a42dc8b2a6c031354bf31472de888bfc8a060132 /src/cp-hash.c | |
parent | cbf5993c43f49281173f185863577d86bfac6eae (diff) | |
download | coreutils-tarball-master.tar.gz |
coreutils-8.25HEADcoreutils-8.25master
Diffstat (limited to 'src/cp-hash.c')
-rw-r--r-- | src/cp-hash.c | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/src/cp-hash.c b/src/cp-hash.c index a4b5157..1b95132 100644 --- a/src/cp-hash.c +++ b/src/cp-hash.c @@ -1,10 +1,10 @@ /* cp-hash.c -- file copying (hash search routines) - Copyright (C) 89, 90, 91, 1995-2005 Free Software Foundation. + Copyright (C) 1989-2016 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + 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. + the Free Software Foundation, either version 3 of the License, 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 @@ -12,22 +12,17 @@ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see <http://www.gnu.org/licenses/>. Written by Torbjorn Granlund, Sweden (tege@sics.se). Rewritten to use lib/hash.c by Jim Meyering. */ #include <config.h> -#include <stdio.h> #include <sys/types.h> #include "system.h" -#include "same.h" -#include "quote.h" #include "hash.h" -#include "error.h" #include "cp-hash.h" /* Use ST_DEV and ST_INO as the key, FILENAME as the value. @@ -64,7 +59,7 @@ src_to_dest_hash (void const *x, size_t table_size) } /* Compare two Src_to_dest entries. - Return true if their keys are judged `equal'. */ + Return true if their keys are judged 'equal'. */ static bool src_to_dest_compare (void const *x, void const *y) { @@ -98,24 +93,6 @@ forget_created (ino_t ino, dev_t dev) src_to_dest_free (ent); } -/* Add FILE to the list of files that we have created. - Return true if successful. */ - -extern bool -remember_created (char const *file) -{ - struct stat sb; - - if (stat (file, &sb) < 0) - { - error (0, errno, "%s", quote (file)); - return false; - } - - remember_copied (file, sb.st_ino, sb.st_dev); - return true; -} - /* If INO/DEV correspond to an already-copied source file, return the name of the corresponding destination file. Otherwise, return NULL. */ @@ -154,7 +131,7 @@ remember_copied (const char *name, ino_t ino, dev_t dev) /* Determine whether there was already an entry in the table with a matching key. If so, free ENT (it wasn't inserted) and - return the `name' from the table entry. */ + return the 'name' from the table entry. */ if (ent_from_table != ent) { src_to_dest_free (ent); @@ -170,14 +147,14 @@ extern void hash_init (void) { src_to_dest = hash_initialize (INITIAL_TABLE_SIZE, NULL, - src_to_dest_hash, - src_to_dest_compare, - src_to_dest_free); + src_to_dest_hash, + src_to_dest_compare, + src_to_dest_free); if (src_to_dest == NULL) xalloc_die (); } -/* Reset the hash structure in the global variable `htab' to +/* Reset the hash structure in the global variable 'htab' to contain no entries. */ extern void |