summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-01-22 08:22:00 +0000
committerJim Meyering <jim@meyering.net>1998-01-22 08:22:00 +0000
commit9cdd2e05e60724343d60203047d2084ce087f2ff (patch)
tree545fa5bff5c1935fbd534adbc9381395a096c8dd /src/copy.c
parent6cce6a1b7f4905a975270b6ac257ea20b276ddae (diff)
downloadcoreutils-9cdd2e05e60724343d60203047d2084ce087f2ff.tar.xz
(copy_internal): Use x->backup_type, not the global.
(valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/copy.c b/src/copy.c
index 29c71723f..a764d8990 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -422,9 +422,10 @@ copy_internal (const char *src_path, const char *dst_path,
return 0;
}
- if (backup_type != none && !S_ISDIR (dst_sb.st_mode))
+ if (x->backup_type != none && !S_ISDIR (dst_sb.st_mode))
{
- char *tmp_backup = find_backup_file_name (dst_path);
+ char *tmp_backup = find_backup_file_name (dst_path,
+ x->backup_type);
if (tmp_backup == NULL)
error (1, 0, _("virtual memory exhausted"));
@@ -755,10 +756,12 @@ valid_options (const struct cp_options *co)
{
assert (co != NULL);
+ assert (VALID_BACKUP_TYPE (co->backup_type));
+
/* FIXME: make sure xstat and dereference are consistent. */
assert (co->xstat);
- assert (co->sparse_mode != SPARSE_UNUSED);
+ assert (VALID_SPARSE_MODE (co->sparse_mode));
return 1;
}
@@ -766,9 +769,7 @@ valid_options (const struct cp_options *co)
any type. NONEXISTENT_DST should be nonzero if the file DST_PATH
is known not to exist (e.g., because its parent directory was just
created); NONEXISTENT_DST should be zero if DST_PATH might already
- exist. DEVICE is the device number of the parent directory of
- DST_PATH, or 0 if the parent of this file is not known.
- OPTIONS is ... FIXME-describe
+ exist. OPTIONS is ... FIXME-describe
Return 0 if successful, 1 if an error occurs. */
int