Changeset 2466 for trunk/src/kmk/kmkbuiltin/cp_utils.c
- Timestamp:
- Jul 12, 2011, 11:52:39 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/cp_utils.c
r2192 r2466 98 98 99 99 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY, 0)) == -1) { 100 warn(" %s", entp->fts_path);100 warn("open: %s", entp->fts_path); 101 101 return (1); 102 102 } … … 124 124 close(from_fd); 125 125 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY, 0)) == -1) { 126 warn(" %s", entp->fts_path);126 warn("open: %s", entp->fts_path); 127 127 return (1); 128 128 } … … 162 162 163 163 if (to_fd == -1) { 164 warn(" %s", to.p_path);164 warn("open: %s", to.p_path); 165 165 (void)close(from_fd); 166 166 return (1); … … 180 180 if ((p = mmap(NULL, (size_t)fs->st_size, PROT_READ, 181 181 MAP_SHARED, from_fd, (off_t)0)) == MAP_FAILED) { 182 warn(" %s", entp->fts_path);182 warn("mmap: %s", entp->fts_path); 183 183 rval = 1; 184 184 } else { … … 200 200 } 201 201 if (wcount != (ssize_t)wresid) { 202 warn(" %s", to.p_path);202 warn("write[%zd != %zu]: %s", wcount, wresid, to.p_path); 203 203 rval = 1; 204 204 } 205 205 /* Some systems don't unmap on close(2). */ 206 206 if (munmap(p, fs->st_size) < 0) { 207 warn(" %s", entp->fts_path);207 warn("munmap: %s", entp->fts_path); 208 208 rval = 1; 209 209 } … … 230 230 } 231 231 if (wcount != (ssize_t)wresid) { 232 warn(" %s", to.p_path);232 warn("write[%zd != %zu]: %s", wcount, wresid, to.p_path); 233 233 rval = 1; 234 234 break; … … 236 236 } 237 237 if (rcount < 0) { 238 warn(" %s", entp->fts_path);238 warn("read: %s", entp->fts_path); 239 239 rval = 1; 240 240 } … … 252 252 (void)close(from_fd); 253 253 if (close(to_fd)) { 254 warn(" %s", to.p_path);254 warn("close: %s", to.p_path); 255 255 rval = 1; 256 256 }
Note:
See TracChangeset
for help on using the changeset viewer.