Changeset 46577995 in mainline for uspace/lib/c/generic/inet/host.c
- Timestamp:
- 2018-01-04T20:50:52Z (8 years ago)
- Children:
- e211ea04
- Parents:
- facacc71
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
- File:
-
- 1 edited
-
uspace/lib/c/generic/inet/host.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet/host.c
rfacacc71 r46577995 54 54 * extra characters at the end. ENOMEM if out of memory 55 55 */ 56 int inet_host_parse(const char *str, inet_host_t **rhost,56 errno_t inet_host_parse(const char *str, inet_host_t **rhost, 57 57 char **endptr) 58 58 { … … 61 61 char *name; 62 62 char *aend; 63 int rc;63 errno_t rc; 64 64 65 65 host = calloc(1, sizeof(inet_host_t)); … … 106 106 * @return EOK on success, ENOMEM if out of memory 107 107 */ 108 int inet_host_format(inet_host_t *host, char **rstr)109 { 110 int rc;108 errno_t inet_host_format(inet_host_t *host, char **rstr) 109 { 110 errno_t rc; 111 111 char *str = NULL; 112 112 … … 161 161 * @reutrn EOK on success, ENOENT on resolurion failure 162 162 */ 163 int inet_host_lookup_one(inet_host_t *host, ip_ver_t version, inet_addr_t *addr)163 errno_t inet_host_lookup_one(inet_host_t *host, ip_ver_t version, inet_addr_t *addr) 164 164 { 165 165 dnsr_hostinfo_t *hinfo = NULL; 166 int rc;166 errno_t rc; 167 167 168 168 switch (host->hform) { … … 201 201 * ENOMEM if out of memory 202 202 */ 203 int inet_host_plookup_one(const char *str, ip_ver_t version, inet_addr_t *addr,203 errno_t inet_host_plookup_one(const char *str, ip_ver_t version, inet_addr_t *addr, 204 204 char **endptr, const char **errmsg) 205 205 { 206 206 inet_host_t *host = NULL; 207 207 char *eptr; 208 int rc;208 errno_t rc; 209 209 210 210 rc = inet_host_parse(str, &host, endptr != NULL ? &eptr : NULL); 211 211 if (rc != EOK) { 212 switch ( rc) {213 case EINVAL:212 switch ((case_errno_t) rc) { 213 case (case_errno_t) EINVAL: 214 214 if (errmsg != NULL) 215 215 *errmsg = "Invalid format"; 216 216 goto error; 217 case ENOMEM:217 case (case_errno_t) ENOMEM: 218 218 if (errmsg != NULL) 219 219 *errmsg = "Out of memory";
Note:
See TracChangeset
for help on using the changeset viewer.
