Changeset 163fc09 in mainline for uspace/lib/c/generic/vfs/vfs.c
- Timestamp:
- 2017-04-02T11:47:52Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- ce04ea44
- Parents:
- 151f1cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
r151f1cc r163fc09 833 833 * @param new New name 834 834 * 835 * @return 0 on success. On error returns -1 and sets errno.836 */ 837 int rename(const char *old, const char *new)835 * @return EOK on success or a negative error code otherwise. 836 */ 837 int vfs_rename_path(const char *old, const char *new) 838 838 { 839 839 sysarg_t rc; … … 843 843 size_t olda_size; 844 844 char *olda = vfs_absolutize(old, &olda_size); 845 if (olda == NULL) { 846 errno = ENOMEM; 847 return -1; 848 } 845 if (olda == NULL) 846 return ENOMEM; 849 847 850 848 size_t newa_size; … … 852 850 if (newa == NULL) { 853 851 free(olda); 854 errno = ENOMEM; 855 return -1; 852 return ENOMEM; 856 853 } 857 854 … … 861 858 free(olda); 862 859 free(newa); 863 errno = ENOENT; 864 return -1; 860 return ENOENT; 865 861 } 866 862 … … 875 871 if (rc_orig != EOK) 876 872 rc = rc_orig; 877 if (rc != EOK) { 878 errno = rc; 879 return -1; 880 } 881 return 0; 873 return rc; 882 874 } 883 875 rc = async_data_write_start(exch, newa, newa_size); … … 890 882 if (rc_orig != EOK) 891 883 rc = rc_orig; 892 if (rc != EOK) { 893 errno = rc; 894 return -1; 895 } 896 return 0; 884 return rc; 897 885 } 898 886 vfs_exchange_end(exch); … … 902 890 async_wait_for(req, &rc); 903 891 904 if (rc != EOK) { 905 errno = rc; 906 return -1; 907 } 908 909 return 0; 892 return rc; 910 893 } 911 894
Note:
See TracChangeset
for help on using the changeset viewer.