diff options
author | Matt Kraai | 2001-10-05 01:35:10 +0000 |
---|---|---|
committer | Matt Kraai | 2001-10-05 01:35:10 +0000 |
commit | 4c557bf576e772bfd78429d5f9b2a436ccadf268 (patch) | |
tree | aa5f6352063fadb09d09d303436cdf3f0f6b79a4 /coreutils | |
parent | 54a992d81e4a875e1710e188a3593fa9762e06a4 (diff) | |
download | busybox-4c557bf576e772bfd78429d5f9b2a436ccadf268.zip busybox-4c557bf576e772bfd78429d5f9b2a436ccadf268.tar.gz |
Invert FILEUTILS_PRESERVE_SYMLINKS into FILEUTILS_DEREFERENCE.
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/cp.c | 8 | ||||
-rw-r--r-- | coreutils/mv.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c index 82d43ad..8f8fe5e 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -36,7 +36,7 @@ extern int cp_main(int argc, char **argv) { int status = 0; int opt; - int flags = 0; + int flags = FILEUTILS_DEREFERENCE; int i; while ((opt = getopt(argc, argv, "adfipR")) != -1) @@ -45,7 +45,7 @@ extern int cp_main(int argc, char **argv) flags |= FILEUTILS_PRESERVE_STATUS | FILEUTILS_RECUR; /* fallthrough */ case 'd': - flags |= FILEUTILS_PRESERVE_SYMLINKS; + flags &= ~FILEUTILS_DEREFERENCE; break; case 'f': flags |= FILEUTILS_FORCE; @@ -73,9 +73,9 @@ extern int cp_main(int argc, char **argv) int source_exists = 1; int dest_exists = 1; - if (((flags & FILEUTILS_PRESERVE_SYMLINKS) && + if ((!(flags & FILEUTILS_DEREFERENCE) && lstat(argv[optind], &source_stat) < 0) || - (!(flags & FILEUTILS_PRESERVE_SYMLINKS) && + ((flags & FILEUTILS_DEREFERENCE) && stat(argv[optind], &source_stat))) { if (errno != ENOENT) perror_msg_and_die("unable to stat `%s'", argv[optind]); diff --git a/coreutils/mv.c b/coreutils/mv.c index b890abf..1c4a347 100644 --- a/coreutils/mv.c +++ b/coreutils/mv.c @@ -74,8 +74,8 @@ static int manual_rename(const char *source, const char *dest) } } - if (copy_file(source, dest, FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS | - FILEUTILS_PRESERVE_SYMLINKS) < 0) + if (copy_file(source, dest, + FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS) < 0) return -1; if (remove_file(source, FILEUTILS_RECUR | FILEUTILS_FORCE) < 0) |