Changeset 3219 for trunk/src/kmk/kmkbuiltin/cp_utils.c
- Timestamp:
- Mar 31, 2018, 12:30:15 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/cp_utils.c
r3192 r3219 102 102 *pcopied = 0; 103 103 104 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY , 0)) == -1) {104 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY | KMK_OPEN_NO_INHERIT, 0)) == -1) { 105 105 warn(pCtx, "open: %s", entp->fts_path); 106 106 return (1); … … 128 128 if (lseek(from_fd, 0, SEEK_SET) != 0) { 129 129 close(from_fd); 130 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY , 0)) == -1) {130 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY | KMK_OPEN_NO_INHERIT, 0)) == -1) { 131 131 warn(pCtx, "open: %s", entp->fts_path); 132 132 return (1); … … 157 157 * create a new file */ 158 158 (void)unlink(to.p_path); 159 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY ,159 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY | KMK_OPEN_NO_INHERIT, 160 160 fs->st_mode & ~(S_ISUID | S_ISGID)); 161 161 } else 162 162 /* overwrite existing destination file name */ 163 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_BINARY , 0);163 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_BINARY | KMK_OPEN_NO_INHERIT, 0); 164 164 } else 165 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY ,165 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY | KMK_OPEN_NO_INHERIT, 166 166 fs->st_mode & ~(S_ISUID | S_ISGID)); 167 167
Note:
See TracChangeset
for help on using the changeset viewer.