Changes in uspace/lib/posix/source/unistd.c [1165a419:f77c1c9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/source/unistd.c
r1165a419 rf77c1c9 213 213 ssize_t posix_read(int fildes, void *buf, size_t nbyte) 214 214 { 215 ssize_t size = rcerrno(vfs_read, fildes, &posix_pos[fildes], buf, nbyte); 216 if (size < 0) 217 return -1; 218 return size; 215 size_t nread; 216 int rc; 217 218 rc = rcerrno(vfs_read, fildes, &posix_pos[fildes], buf, nbyte, &nread); 219 if (rc != EOK) 220 return -1; 221 return (ssize_t) nread; 219 222 } 220 223 … … 229 232 ssize_t posix_write(int fildes, const void *buf, size_t nbyte) 230 233 { 231 ssize_t size = rcerrno(vfs_write, fildes, &posix_pos[fildes], buf, nbyte); 232 if (size < 0) 233 return -1; 234 return size; 234 size_t nwr; 235 int rc; 236 237 rc = rcerrno(vfs_write, fildes, &posix_pos[fildes], buf, nbyte, &nwr); 238 if (rc != EOK) 239 return -1; 240 return nwr; 235 241 } 236 242 … … 349 355 int posix_dup2(int fildes, int fildes2) 350 356 { 351 return negerrno(vfs_clone, fildes, fildes2, false); 357 int file; 358 int rc = vfs_clone(fildes, fildes2, false, &file); 359 if (rc != EOK) { 360 errno = rc < 0 ? -rc : rc; 361 return -1; 362 } 363 return file; 352 364 } 353 365
Note:
See TracChangeset
for help on using the changeset viewer.