aboutsummaryrefslogtreecommitdiff
path: root/libbb/copy_file.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 /libbb/copy_file.c
parent9ff9325e60eac6cc119eab5dff0dbbba78edfd32 (diff)
downloadbusybox-01441036e9754425e2b09b43deec879ca46206cb.tar.gz
Use generic flag names.
Diffstat (limited to 'libbb/copy_file.c')
-rw-r--r--libbb/copy_file.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index f24d1b119..4ee3efdbc 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -39,8 +39,9 @@ int copy_file(const char *source, const char *dest, int flags)
int dest_exists = 1;
int status = 0;
- if (((flags & CP_PRESERVE_SYMLINKS) && lstat(source, &source_stat) < 0) ||
- (!(flags & CP_PRESERVE_SYMLINKS) &&
+ if (((flags & FILEUTILS_PRESERVE_SYMLINKS) &&
+ lstat(source, &source_stat) < 0) ||
+ (!(flags & FILEUTILS_PRESERVE_SYMLINKS) &&
stat(source, &source_stat) < 0)) {
perror_msg("%s", source);
return -1;
@@ -64,7 +65,7 @@ int copy_file(const char *source, const char *dest, int flags)
DIR *dp;
struct dirent *d;
- if (!(flags & CP_RECUR)) {
+ if (!(flags & FILEUTILS_RECUR)) {
error_msg("%s: omitting directory", source);
return -1;
}
@@ -80,7 +81,7 @@ int copy_file(const char *source, const char *dest, int flags)
saved_umask = umask(0);
mode = source_stat.st_mode;
- if (!(flags & CP_PRESERVE_STATUS))
+ if (!(flags & FILEUTILS_PRESERVE_STATUS))
mode = source_stat.st_mode & ~saved_umask;
mode |= S_IRWXU;
@@ -125,14 +126,14 @@ int copy_file(const char *source, const char *dest, int flags)
FILE *sfp, *dfp;
if (dest_exists) {
- if (flags & CP_INTERACTIVE) {
+ if (flags & FILEUTILS_INTERACTIVE) {
fprintf(stderr, "%s: overwrite `%s'? ", applet_name, dest);
if (!ask_confirmation())
return 0;
}
if ((dfp = fopen(dest, "w")) == NULL) {
- if (!(flags & CP_FORCE)) {
+ if (!(flags & FILEUTILS_FORCE)) {
perror_msg("unable to open `%s'", dest);
return -1;
}
@@ -187,7 +188,7 @@ int copy_file(const char *source, const char *dest, int flags)
saved_umask = umask(0);
mode = source_stat.st_mode;
- if (!(flags & CP_PRESERVE_STATUS))
+ if (!(flags & FILEUTILS_PRESERVE_STATUS))
mode = source_stat.st_mode & ~saved_umask;
mode |= S_IRWXU;
@@ -213,7 +214,7 @@ int copy_file(const char *source, const char *dest, int flags)
}
#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
- if (flags & CP_PRESERVE_STATUS)
+ if (flags & FILEUTILS_PRESERVE_STATUS)
if (lchown(dest, source_stat.st_uid, source_stat.st_gid) < 0)
perror_msg("unable to preserve ownership of `%s'", dest);
#endif
@@ -225,7 +226,7 @@ int copy_file(const char *source, const char *dest, int flags)
end:
- if (flags & CP_PRESERVE_STATUS) {
+ if (flags & FILEUTILS_PRESERVE_STATUS) {
struct utimbuf times;
times.actime = source_stat.st_atime;