summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-07-02 10:52:34 +0000
committerrrs <rrs@FreeBSD.org>2007-07-02 10:52:34 +0000
commit9915cae1cee2f3b9dc631b8bfa3ddb6125916568 (patch)
tree6a629d4c713a1bfc7638d96adc52f8d86558f55b /lib
parentab67a078687c55227d438cdeab0c7fd9f800f520 (diff)
downloadFreeBSD-src-9915cae1cee2f3b9dc631b8bfa3ddb6125916568.zip
FreeBSD-src-9915cae1cee2f3b9dc631b8bfa3ddb6125916568.tar.gz
- Removes some incorrect error returns (errno was being overriden in
one of the functions) - Fixes the error return of sctp_get_opt, it was returning the errno not -1. Approved by: re@freebsd.org (Robert Watson) Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/sctp_sys_calls.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c
index d2040b1..153f531 100644
--- a/lib/libc/net/sctp_sys_calls.c
+++ b/lib/libc/net/sctp_sys_calls.c
@@ -295,7 +295,8 @@ int
sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size)
{
if (arg == NULL) {
- return (EINVAL);
+ errno = EINVAL;
+ return (-1);
}
*(sctp_assoc_t *) arg = id;
return (getsockopt(sd, IPPROTO_SCTP, opt, arg, size));
@@ -320,7 +321,6 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
siz = sizeof(sctp_assoc_t);
if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE,
&asoc, &siz) != 0) {
- errno = ENOMEM;
return (-1);
}
/* size required is returned in 'asoc' */
@@ -328,7 +328,6 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
siz += sizeof(struct sctp_getaddresses);
addrs = calloc(1, siz);
if (addrs == NULL) {
- errno = ENOMEM;
return (-1);
}
addrs->sget_assoc_id = id;
@@ -336,7 +335,6 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDRESSES,
addrs, &siz) != 0) {
free(addrs);
- errno = ENOMEM;
return (-1);
}
re = (struct sockaddr *)&addrs->addr[0];
OpenPOWER on IntegriCloud