Changeset 59f388a in mainline for uspace/lib/posix/source/sys/stat.c
- Timestamp:
- 2017-04-04T20:56:47Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 51774cd
- Parents:
- 8fe46a0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/source/sys/stat.c
r8fe46a0 r59f388a 49 49 * @param dest POSIX stat struct. 50 50 * @param src HelenOS stat struct. 51 * 52 * @return 0 on success, -1 on error. 51 53 */ 52 static voidstat_to_posix(struct posix_stat *dest, struct stat *src)54 static int stat_to_posix(struct posix_stat *dest, struct stat *src) 53 55 { 54 56 memset(dest, 0, sizeof(struct posix_stat)); … … 68 70 dest->st_nlink = src->lnkcnt; 69 71 dest->st_size = src->size; 72 73 if (src->size > INT64_MAX) { 74 errno = ERANGE; 75 return -1; 76 } 77 78 return 0; 70 79 } 71 80 … … 83 92 if (rc < 0) 84 93 return -1; 85 stat_to_posix(st, &hst); 86 return 0; 94 return stat_to_posix(st, &hst); 87 95 } 88 96 … … 113 121 if (rc < 0) 114 122 return -1; 115 stat_to_posix(st, &hst); 116 return 0; 123 return stat_to_posix(st, &hst); 117 124 } 118 125
Note:
See TracChangeset
for help on using the changeset viewer.