Changeset 2485
- Timestamp:
- 02/04/07 18:18:27 (2 years ago)
- Files:
-
- trunk/lib_internal/unify-copy.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib_internal/unify-copy.c
r1977 r2485 84 84 { 85 85 #if 1 86 // Do not use memcpy because this would dirty pages consisting only of 87 // '\0' 86 88 int *dst = dst_v; 87 89 int const *src = src_v; … … 120 122 121 123 if (in_len==-1) return false; 122 if (in_len>0 && 123 (lseek(out_fd, in_len-1, SEEK_SET)==-1 || 124 write(out_fd, "\0", 1)!=1)) // create sparse file 124 if (in_len>0 && ftruncate(out_fd, in_len)==-1) // create sparse file 125 125 return false; 126 126 … … 165 165 { 166 166 int in_fd = open(src, O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_LARGEFILE); 167 int out_fd = in_fd==-1 ? -1 : open(dst, O_RDWR|O_CREAT|O_EXCL , 0200);167 int out_fd = in_fd==-1 ? -1 : open(dst, O_RDWR|O_CREAT|O_EXCL|O_NOCTTY, 0200); 168 168 bool res = false; 169 169
