diff options
author | Jim Meyering <jim@meyering.net> | 2000-08-14 09:58:25 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-08-14 09:58:25 +0000 |
commit | 0f8dd3a95412ade3dd0a4efdb917aa3fab623f51 (patch) | |
tree | 9a2987725d8817b45e05d5835e7003c218fd111f /src | |
parent | d927d60b3642dcd471529d679292570671703dd3 (diff) | |
download | coreutils-0f8dd3a95412ade3dd0a4efdb917aa3fab623f51.tar.xz |
(copy_reg): Move declaration of local, `n_read', into
the scope where it's used.
(copy_internal): In calling copy_reg, pass not the raw `src_mode',
but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
Diffstat (limited to 'src')
-rw-r--r-- | src/copy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/copy.c b/src/copy.c index 712f81f67..ef3ab174f 100644 --- a/src/copy.c +++ b/src/copy.c @@ -169,7 +169,6 @@ copy_reg (const char *src_path, const char *dst_path, int buf_size; int dest_desc; int source_desc; - int n_read; struct stat sb; char *cp; int *ip; @@ -241,7 +240,7 @@ copy_reg (const char *src_path, const char *dst_path, for (;;) { - n_read = read (source_desc, buf, buf_size); + int n_read = read (source_desc, buf, buf_size); if (n_read < 0) { #ifdef EINTR @@ -815,8 +814,10 @@ copy_internal (const char *src_path, const char *dst_path, { copied_as_regular = 1; /* POSIX says the permission bits of the source file must be - used as the 3rd argument in the open call. */ - if (copy_reg (src_path, dst_path, x->sparse_mode, src_mode)) + used as the 3rd argument in the open call, but that's not consistent + with historical practice. */ + if (copy_reg (src_path, dst_path, x->sparse_mode, + get_dest_mode (x, src_mode))) goto un_backup; } else |