Changeset 46577995 in mainline for uspace/lib/c/generic/inet/hostport.c
- Timestamp:
- 2018-01-04T20:50:52Z (6 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
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet/hostport.c
rfacacc71 r46577995 56 56 * extra characters at the end. ENOMEM if out of memory 57 57 */ 58 int inet_hostport_parse(const char *str, inet_hostport_t **rhp,58 errno_t inet_hostport_parse(const char *str, inet_hostport_t **rhp, 59 59 char **endptr) 60 60 { … … 65 65 char *aend; 66 66 const char *pend; 67 int rc;67 errno_t rc; 68 68 69 69 hp = calloc(1, sizeof(inet_hostport_t)); … … 137 137 * @return EOK on success, ENOMEM if out of memory 138 138 */ 139 int inet_hostport_format(inet_hostport_t *hp, char **rstr)140 { 141 int rc;139 errno_t inet_hostport_format(inet_hostport_t *hp, char **rstr) 140 { 141 errno_t rc; 142 142 int ret; 143 143 char *astr, *str; … … 211 211 * @return EOK on success, ENOENT on resolution failure 212 212 */ 213 int inet_hostport_lookup_one(inet_hostport_t *hp, ip_ver_t version,213 errno_t inet_hostport_lookup_one(inet_hostport_t *hp, ip_ver_t version, 214 214 inet_ep_t *ep) 215 215 { 216 216 dnsr_hostinfo_t *hinfo = NULL; 217 int rc;217 errno_t rc; 218 218 219 219 inet_ep_init(ep); … … 255 255 * ENOMEM if out of memory 256 256 */ 257 int inet_hostport_plookup_one(const char *str, ip_ver_t version, inet_ep_t *ep,257 errno_t inet_hostport_plookup_one(const char *str, ip_ver_t version, inet_ep_t *ep, 258 258 char **endptr, const char **errmsg) 259 259 { 260 260 inet_hostport_t *hp = NULL; 261 261 char *eptr; 262 int rc;262 errno_t rc; 263 263 264 264 rc = inet_hostport_parse(str, &hp, endptr != NULL ? &eptr : NULL); 265 265 if (rc != EOK) { 266 switch ( rc) {267 case EINVAL:266 switch ((case_errno_t) rc) { 267 case (case_errno_t) EINVAL: 268 268 if (errmsg != NULL) 269 269 *errmsg = "Invalid format"; 270 270 goto error; 271 case ENOMEM:271 case (case_errno_t) ENOMEM: 272 272 if (errmsg != NULL) 273 273 *errmsg = "Out of memory"; 274 274 goto error; 275 case EOK:275 case (case_errno_t) EOK: 276 276 break; 277 277 default:
Note:
See TracChangeset
for help on using the changeset viewer.