aboutsummaryrefslogtreecommitdiff
path: root/mv.c
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-04-24 01:30:02 +0000
committerMatt Kraai <kraai@debian.org>2001-04-24 01:30:02 +0000
commit01441036e9754425e2b09b43deec879ca46206cb (patch)
treed9d4c66bb7d2142dd525adfa3a9cae07e3f80557 /mv.c
parent9ff9325e60eac6cc119eab5dff0dbbba78edfd32 (diff)
downloadbusybox-w32-01441036e9754425e2b09b43deec879ca46206cb.tar.gz
busybox-w32-01441036e9754425e2b09b43deec879ca46206cb.tar.bz2
busybox-w32-01441036e9754425e2b09b43deec879ca46206cb.zip
Use generic flag names.
Diffstat (limited to 'mv.c')
-rw-r--r--mv.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mv.c b/mv.c
index 13d1aae5b..efc4ae6d8 100644
--- a/mv.c
+++ b/mv.c
@@ -30,7 +30,7 @@
30 30
31#include "busybox.h" 31#include "busybox.h"
32 32
33static int flags = CP_RECUR | CP_PRESERVE_STATUS | CP_PRESERVE_SYMLINKS; 33static int flags;
34 34
35static int remove_file(const char *path, struct stat *statbuf, void *junk) 35static int remove_file(const char *path, struct stat *statbuf, void *junk)
36{ 36{
@@ -88,8 +88,8 @@ static int manual_rename(const char *source, const char *dest)
88 } 88 }
89 } 89 }
90 90
91 if (copy_file(source, dest, 91 if (copy_file(source, dest, FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS |
92 CP_RECUR | CP_PRESERVE_STATUS | CP_PRESERVE_SYMLINKS) < 0) 92 FILEUTILS_PRESERVE_SYMLINKS) < 0)
93 return -1; 93 return -1;
94 94
95 if (!recursive_action(source, TRUE, FALSE, TRUE, remove_file, 95 if (!recursive_action(source, TRUE, FALSE, TRUE, remove_file,
@@ -112,9 +112,9 @@ static int move_file(const char *source, const char *dest)
112 dest_exists = 0; 112 dest_exists = 0;
113 } 113 }
114 114
115 if (dest_exists && !(flags & CP_FORCE) && 115 if (dest_exists && !(flags & FILEUTILS_FORCE) &&
116 ((access(dest, W_OK) < 0 && isatty(0)) || 116 ((access(dest, W_OK) < 0 && isatty(0)) ||
117 (flags & CP_INTERACTIVE))) { 117 (flags & FILEUTILS_INTERACTIVE))) {
118 fprintf(stderr, "mv: overwrite `%s'? ", dest); 118 fprintf(stderr, "mv: overwrite `%s'? ", dest);
119 if (!ask_confirmation()) 119 if (!ask_confirmation())
120 return 0; 120 return 0;
@@ -140,12 +140,12 @@ extern int mv_main(int argc, char **argv)
140 while ((opt = getopt(argc, argv, "fi")) != -1) 140 while ((opt = getopt(argc, argv, "fi")) != -1)
141 switch (opt) { 141 switch (opt) {
142 case 'f': 142 case 'f':
143 flags &= ~CP_INTERACTIVE; 143 flags &= ~FILEUTILS_INTERACTIVE;
144 flags |= CP_FORCE; 144 flags |= FILEUTILS_FORCE;
145 break; 145 break;
146 case 'i': 146 case 'i':
147 flags &= ~CP_FORCE; 147 flags &= ~FILEUTILS_FORCE;
148 flags |= CP_INTERACTIVE; 148 flags |= FILEUTILS_INTERACTIVE;
149 break; 149 break;
150 default: 150 default:
151 show_usage(); 151 show_usage();