diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-28 12:22:49 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-28 12:22:49 +0000 |
commit | 2fa687d090856686870ca4afa9ec57872b15eb0d (patch) | |
tree | c25461766e6f413226085655335567c52e84f395 | |
parent | cdcc16e4bfbf303a18798ec7c830fd50cdc20542 (diff) | |
download | cpio-2fa687d090856686870ca4afa9ec57872b15eb0d.tar.gz cpio-2fa687d090856686870ca4afa9ec57872b15eb0d.tar.bz2 |
Save current umask before processing and call apply_delayed_set_stat afterwards
-rw-r--r-- | src/copyin.c | 4 | ||||
-rw-r--r-- | src/copypass.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/copyin.c b/src/copyin.c index 4ed8cd7..ce4ff38 100644 --- a/src/copyin.c +++ b/src/copyin.c @@ -1361,7 +1361,7 @@ process_copy_in () char skip_file; /* Flag for use with patterns. */ int i; /* Loop index variable. */ - umask (0); /* Reset umask to preserve modes of + newdir_umask = umask (0); /* Reset umask to preserve modes of created files */ /* Initialize the copy in. */ @@ -1562,6 +1562,8 @@ process_copy_in () if (dot_flag) fputc ('\n', stderr); + apply_delayed_set_stat (); + if (append_flag) return; diff --git a/src/copypass.c b/src/copypass.c index 44b4117..8941b76 100644 --- a/src/copypass.c +++ b/src/copypass.c @@ -64,7 +64,7 @@ process_copy_pass () int cdf_char; #endif - umask (0); /* Reset umask to preserve modes of + newdir_umask = umask (0); /* Reset umask to preserve modes of created files */ /* Initialize the copy pass. */ @@ -364,6 +364,9 @@ process_copy_pass () if (dot_flag) fputc ('\n', stderr); + + apply_delayed_set_stat (); + if (!quiet_flag) { size_t blocks = (output_bytes + io_block_size - 1) / io_block_size; |