Changeset 6afc9d7 in mainline for uspace/lib/posix/source/stdio.c
- Timestamp:
- 2015-10-06T19:01:36Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0328987
- Parents:
- f1f7584
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/source/stdio.c
rf1f7584 r6afc9d7 315 315 int posix_fflush(FILE *stream) 316 316 { 317 int rc = fflush(stream); 318 if (rc < 0) { 319 errno = -rc; 320 return EOF; 321 } else { 322 return 0; 323 } 317 return negerrno(fflush, stream); 324 318 } 325 319 … … 351 345 { 352 346 ssize_t wr = write(*(int *) fd, str, size); 347 if (wr < 0) 348 return errno; 353 349 return str_nlength(str, wr); 354 350 } … … 579 575 int posix_remove(const char *path) 580 576 { 581 struct stat st; 582 int rc = stat(path, &st); 583 584 if (rc != EOK) { 585 errno = -rc; 586 return -1; 587 } 588 589 if (st.is_directory) { 590 rc = rmdir(path); 591 } else { 592 rc = unlink(path); 593 } 594 595 if (rc != EOK) { 596 errno = -rc; 597 return -1; 598 } 599 return 0; 577 return negerrno(remove, path); 600 578 } 601 579 … … 609 587 int posix_rename(const char *old, const char *new) 610 588 { 611 return errnify(rename, old, new);589 return negerrno(rename, old, new); 612 590 } 613 591
Note:
See TracChangeset
for help on using the changeset viewer.