- Timestamp:
- Dec 11, 2005, 6:12:41 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/kmkbuiltin/cp_utils.c
r229 r347 59 59 #define MAXBSIZE (128*1024) 60 60 #endif 61 #ifndef O_BINARY 62 # define O_BINARY 0 63 #endif 61 64 62 65 int … … 74 77 #endif 75 78 76 if ((from_fd = open(entp->fts_path, O_RDONLY , 0)) == -1) {79 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY, 0)) == -1) { 77 80 fprintf(stderr, "%s: %s: %s\n", argv0, entp->fts_path, strerror(errno)); 78 81 return (1); … … 112 115 * create a new file */ 113 116 (void)unlink(to.p_path); 114 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT ,117 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 115 118 fs->st_mode & ~(S_ISUID | S_ISGID)); 116 119 } else 117 120 /* overwrite existing destination file name */ 118 to_fd = open(to.p_path, O_WRONLY | O_TRUNC , 0);121 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_BINARY, 0); 119 122 } else 120 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT ,123 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 121 124 fs->st_mode & ~(S_ISUID | S_ISGID)); 122 125
Note:
See TracChangeset
for help on using the changeset viewer.