Changes in uspace/lib/c/generic/inet/hostport.c [a62ceaf:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet/hostport.c
ra62ceaf rb7fd2a0 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 int ret; 142 143 char *astr, *str; 143 144 char *hstr = NULL; … … 154 155 hstr = astr; 155 156 } else { 156 r c= asprintf(&hstr, "[%s]", astr);157 if (r c< 0) {157 ret = asprintf(&hstr, "[%s]", astr); 158 if (ret < 0) { 158 159 free(astr); 159 160 return ENOMEM; … … 171 172 } 172 173 173 r c= asprintf(&str, "%s:%u", hstr, hp->port);174 if (r c< 0)174 ret = asprintf(&str, "%s:%u", hstr, hp->port); 175 if (ret < 0) 175 176 return ENOMEM; 176 177 … … 210 211 * @return EOK on success, ENOENT on resolution failure 211 212 */ 212 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, 213 214 inet_ep_t *ep) 214 215 { 215 216 dnsr_hostinfo_t *hinfo = NULL; 216 int rc;217 errno_t rc; 217 218 218 219 inet_ep_init(ep); … … 254 255 * ENOMEM if out of memory 255 256 */ 256 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, 257 258 char **endptr, const char **errmsg) 258 259 { 259 260 inet_hostport_t *hp = NULL; 260 261 char *eptr; 261 int rc;262 errno_t rc; 262 263 263 264 rc = inet_hostport_parse(str, &hp, endptr != NULL ? &eptr : NULL);
Note:
See TracChangeset
for help on using the changeset viewer.