diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-13 09:08:27 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-13 09:08:27 +0100 |
commit | 6331cf059ccfdf35f4e5a505cbae885094cc41b0 (patch) | |
tree | ccb4b4f0d96d9636861a75f7fc6c97b8b15bd306 /libbb/copy_file.c | |
parent | f4fee418ae9f5308b4d32bc8d4e618f779f3203f (diff) | |
download | busybox-w32-6331cf059ccfdf35f4e5a505cbae885094cc41b0.tar.gz busybox-w32-6331cf059ccfdf35f4e5a505cbae885094cc41b0.tar.bz2 busybox-w32-6331cf059ccfdf35f4e5a505cbae885094cc41b0.zip |
*: use "can't" instead of "cannot"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/copy_file.c')
-rw-r--r-- | libbb/copy_file.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c index ae70cbc0a..ff298855d 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c | |||
@@ -30,12 +30,12 @@ static int ask_and_unlink(const char *dest, int flags) | |||
30 | #if !ENABLE_FEATURE_NON_POSIX_CP | 30 | #if !ENABLE_FEATURE_NON_POSIX_CP |
31 | if (!(flags & (FILEUTILS_FORCE|FILEUTILS_INTERACTIVE))) { | 31 | if (!(flags & (FILEUTILS_FORCE|FILEUTILS_INTERACTIVE))) { |
32 | /* Either it exists, or the *path* doesnt exist */ | 32 | /* Either it exists, or the *path* doesnt exist */ |
33 | bb_perror_msg("cannot create '%s'", dest); | 33 | bb_perror_msg("can't create '%s'", dest); |
34 | return -1; | 34 | return -1; |
35 | } | 35 | } |
36 | #endif | 36 | #endif |
37 | // else: act as if -f is always in effect. | 37 | // else: act as if -f is always in effect. |
38 | // We don't want "cannot create" msg, we want unlink to be done | 38 | // We don't want "can't create" msg, we want unlink to be done |
39 | // (silently unless -i). Why? POSIX cp usually succeeds with | 39 | // (silently unless -i). Why? POSIX cp usually succeeds with |
40 | // O_TRUNC open of existing file, and user is left ignorantly happy. | 40 | // O_TRUNC open of existing file, and user is left ignorantly happy. |
41 | // With above block unconditionally enabled, non-POSIX cp | 41 | // With above block unconditionally enabled, non-POSIX cp |
@@ -56,12 +56,12 @@ static int ask_and_unlink(const char *dest, int flags) | |||
56 | if (e == errno && e == ENOENT) { | 56 | if (e == errno && e == ENOENT) { |
57 | /* e == ENOTDIR is similar: path has non-dir component, | 57 | /* e == ENOTDIR is similar: path has non-dir component, |
58 | * but in this case we don't even reach copy_file() */ | 58 | * but in this case we don't even reach copy_file() */ |
59 | bb_error_msg("cannot create '%s': Path does not exist", dest); | 59 | bb_error_msg("can't create '%s': Path does not exist", dest); |
60 | return -1; /* error */ | 60 | return -1; /* error */ |
61 | } | 61 | } |
62 | #endif | 62 | #endif |
63 | errno = e; /* do not use errno from unlink */ | 63 | errno = e; /* do not use errno from unlink */ |
64 | bb_perror_msg("cannot create '%s'", dest); | 64 | bb_perror_msg("can't create '%s'", dest); |
65 | return -1; /* error */ | 65 | return -1; /* error */ |
66 | } | 66 | } |
67 | return 1; /* ok (to try again) */ | 67 | return 1; /* ok (to try again) */ |
@@ -90,13 +90,13 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
90 | * Making [sym]links to dangling symlinks works, so... */ | 90 | * Making [sym]links to dangling symlinks works, so... */ |
91 | if (flags & (FILEUTILS_MAKE_SOFTLINK|FILEUTILS_MAKE_HARDLINK)) | 91 | if (flags & (FILEUTILS_MAKE_SOFTLINK|FILEUTILS_MAKE_HARDLINK)) |
92 | goto make_links; | 92 | goto make_links; |
93 | bb_perror_msg("cannot stat '%s'", source); | 93 | bb_perror_msg("can't stat '%s'", source); |
94 | return -1; | 94 | return -1; |
95 | } | 95 | } |
96 | 96 | ||
97 | if (lstat(dest, &dest_stat) < 0) { | 97 | if (lstat(dest, &dest_stat) < 0) { |
98 | if (errno != ENOENT) { | 98 | if (errno != ENOENT) { |
99 | bb_perror_msg("cannot stat '%s'", dest); | 99 | bb_perror_msg("can't stat '%s'", dest); |
100 | return -1; | 100 | return -1; |
101 | } | 101 | } |
102 | } else { | 102 | } else { |
@@ -114,14 +114,14 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
114 | security_context_t con; | 114 | security_context_t con; |
115 | if (lgetfilecon(source, &con) >= 0) { | 115 | if (lgetfilecon(source, &con) >= 0) { |
116 | if (setfscreatecon(con) < 0) { | 116 | if (setfscreatecon(con) < 0) { |
117 | bb_perror_msg("cannot set setfscreatecon %s", con); | 117 | bb_perror_msg("can't set setfscreatecon %s", con); |
118 | freecon(con); | 118 | freecon(con); |
119 | return -1; | 119 | return -1; |
120 | } | 120 | } |
121 | } else if (errno == ENOTSUP || errno == ENODATA) { | 121 | } else if (errno == ENOTSUP || errno == ENODATA) { |
122 | setfscreatecon_or_die(NULL); | 122 | setfscreatecon_or_die(NULL); |
123 | } else { | 123 | } else { |
124 | bb_perror_msg("cannot lgetfilecon %s", source); | 124 | bb_perror_msg("can't lgetfilecon %s", source); |
125 | return -1; | 125 | return -1; |
126 | } | 126 | } |
127 | } | 127 | } |
@@ -166,13 +166,13 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
166 | mode |= S_IRWXU; | 166 | mode |= S_IRWXU; |
167 | if (mkdir(dest, mode) < 0) { | 167 | if (mkdir(dest, mode) < 0) { |
168 | umask(saved_umask); | 168 | umask(saved_umask); |
169 | bb_perror_msg("cannot create directory '%s'", dest); | 169 | bb_perror_msg("can't create directory '%s'", dest); |
170 | return -1; | 170 | return -1; |
171 | } | 171 | } |
172 | umask(saved_umask); | 172 | umask(saved_umask); |
173 | /* need stat info for add_to_ino_dev_hashtable */ | 173 | /* need stat info for add_to_ino_dev_hashtable */ |
174 | if (lstat(dest, &dest_stat) < 0) { | 174 | if (lstat(dest, &dest_stat) < 0) { |
175 | bb_perror_msg("cannot stat '%s'", dest); | 175 | bb_perror_msg("can't stat '%s'", dest); |
176 | return -1; | 176 | return -1; |
177 | } | 177 | } |
178 | } | 178 | } |
@@ -204,7 +204,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
204 | if (!dest_exists | 204 | if (!dest_exists |
205 | && chmod(dest, source_stat.st_mode & ~saved_umask) < 0 | 205 | && chmod(dest, source_stat.st_mode & ~saved_umask) < 0 |
206 | ) { | 206 | ) { |
207 | bb_perror_msg("cannot preserve %s of '%s'", "permissions", dest); | 207 | bb_perror_msg("can't preserve %s of '%s'", "permissions", dest); |
208 | /* retval = -1; - WRONG! copy *WAS* made */ | 208 | /* retval = -1; - WRONG! copy *WAS* made */ |
209 | } | 209 | } |
210 | goto preserve_mode_ugid_time; | 210 | goto preserve_mode_ugid_time; |
@@ -222,7 +222,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
222 | if (ovr <= 0) | 222 | if (ovr <= 0) |
223 | return ovr; | 223 | return ovr; |
224 | if (lf(source, dest) < 0) { | 224 | if (lf(source, dest) < 0) { |
225 | bb_perror_msg("cannot create link '%s'", dest); | 225 | bb_perror_msg("can't create link '%s'", dest); |
226 | return -1; | 226 | return -1; |
227 | } | 227 | } |
228 | } | 228 | } |
@@ -257,7 +257,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
257 | if (ovr <= 0) | 257 | if (ovr <= 0) |
258 | return ovr; | 258 | return ovr; |
259 | if (link(link_target, dest) < 0) { | 259 | if (link(link_target, dest) < 0) { |
260 | bb_perror_msg("cannot create link '%s'", dest); | 260 | bb_perror_msg("can't create link '%s'", dest); |
261 | return -1; | 261 | return -1; |
262 | } | 262 | } |
263 | } | 263 | } |
@@ -318,7 +318,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
318 | retval = -1; | 318 | retval = -1; |
319 | /* Ok, writing side I can understand... */ | 319 | /* Ok, writing side I can understand... */ |
320 | if (close(dst_fd) < 0) { | 320 | if (close(dst_fd) < 0) { |
321 | bb_perror_msg("cannot close '%s'", dest); | 321 | bb_perror_msg("can't close '%s'", dest); |
322 | retval = -1; | 322 | retval = -1; |
323 | } | 323 | } |
324 | /* ...but read size is already checked by bb_copyfd_eof */ | 324 | /* ...but read size is already checked by bb_copyfd_eof */ |
@@ -345,12 +345,12 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
345 | int r = symlink(lpath, dest); | 345 | int r = symlink(lpath, dest); |
346 | free(lpath); | 346 | free(lpath); |
347 | if (r < 0) { | 347 | if (r < 0) { |
348 | bb_perror_msg("cannot create symlink '%s'", dest); | 348 | bb_perror_msg("can't create symlink '%s'", dest); |
349 | return -1; | 349 | return -1; |
350 | } | 350 | } |
351 | if (flags & FILEUTILS_PRESERVE_STATUS) | 351 | if (flags & FILEUTILS_PRESERVE_STATUS) |
352 | if (lchown(dest, source_stat.st_uid, source_stat.st_gid) < 0) | 352 | if (lchown(dest, source_stat.st_uid, source_stat.st_gid) < 0) |
353 | bb_perror_msg("cannot preserve %s of '%s'", "ownership", dest); | 353 | bb_perror_msg("can't preserve %s of '%s'", "ownership", dest); |
354 | } | 354 | } |
355 | /* _Not_ jumping to preserve_mode_ugid_time: | 355 | /* _Not_ jumping to preserve_mode_ugid_time: |
356 | * symlinks don't have those */ | 356 | * symlinks don't have those */ |
@@ -360,7 +360,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
360 | || S_ISSOCK(source_stat.st_mode) || S_ISFIFO(source_stat.st_mode) | 360 | || S_ISSOCK(source_stat.st_mode) || S_ISFIFO(source_stat.st_mode) |
361 | ) { | 361 | ) { |
362 | if (mknod(dest, source_stat.st_mode, source_stat.st_rdev) < 0) { | 362 | if (mknod(dest, source_stat.st_mode, source_stat.st_rdev) < 0) { |
363 | bb_perror_msg("cannot create '%s'", dest); | 363 | bb_perror_msg("can't create '%s'", dest); |
364 | return -1; | 364 | return -1; |
365 | } | 365 | } |
366 | } else { | 366 | } else { |
@@ -380,13 +380,13 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
380 | times.modtime = source_stat.st_mtime; | 380 | times.modtime = source_stat.st_mtime; |
381 | /* BTW, utimes sets usec-precision time - just FYI */ | 381 | /* BTW, utimes sets usec-precision time - just FYI */ |
382 | if (utime(dest, ×) < 0) | 382 | if (utime(dest, ×) < 0) |
383 | bb_perror_msg("cannot preserve %s of '%s'", "times", dest); | 383 | bb_perror_msg("can't preserve %s of '%s'", "times", dest); |
384 | if (chown(dest, source_stat.st_uid, source_stat.st_gid) < 0) { | 384 | if (chown(dest, source_stat.st_uid, source_stat.st_gid) < 0) { |
385 | source_stat.st_mode &= ~(S_ISUID | S_ISGID); | 385 | source_stat.st_mode &= ~(S_ISUID | S_ISGID); |
386 | bb_perror_msg("cannot preserve %s of '%s'", "ownership", dest); | 386 | bb_perror_msg("can't preserve %s of '%s'", "ownership", dest); |
387 | } | 387 | } |
388 | if (chmod(dest, source_stat.st_mode) < 0) | 388 | if (chmod(dest, source_stat.st_mode) < 0) |
389 | bb_perror_msg("cannot preserve %s of '%s'", "permissions", dest); | 389 | bb_perror_msg("can't preserve %s of '%s'", "permissions", dest); |
390 | } | 390 | } |
391 | 391 | ||
392 | return retval; | 392 | return retval; |