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