From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 12:49:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 742365EA; Sun, 4 Nov 2012 12:49:37 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 30D878FC0A; Sun, 4 Nov 2012 12:49:37 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id BE763AC7; Sun, 4 Nov 2012 13:48:05 +0100 (CET) Date: Sun, 4 Nov 2012 13:50:22 +0100 From: Pawel Jakub Dawidek To: Michael Tuexen Subject: Re: svn commit: r242512 - head/lib/libc/net Message-ID: <20121104125021.GS1399@garage.freebsd.pl> References: <201211031322.qA3DMQPg072355@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZcSDOt7TZFizttpn" Content-Disposition: inline In-Reply-To: <201211031322.qA3DMQPg072355@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 12:49:37 -0000 --ZcSDOt7TZFizttpn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 03, 2012 at 01:22:26PM +0000, Michael Tuexen wrote: > Author: tuexen > Date: Sat Nov 3 13:22:25 2012 > New Revision: 242512 > URL: http://svn.freebsd.org/changeset/base/242512 >=20 > Log: > Fix errno in a couple of error cases. > =20 > MFC after: 3 days >=20 > Modified: > head/lib/libc/net/sctp_sys_calls.c >=20 > Modified: head/lib/libc/net/sctp_sys_calls.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/net/sctp_sys_calls.c Sat Nov 3 09:18:37 2012 (r242511) > +++ head/lib/libc/net/sctp_sys_calls.c Sat Nov 3 13:22:25 2012 (r242512) > @@ -449,6 +449,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id,=20 > opt_len =3D (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses= )); > addrs =3D calloc(1, (size_t)opt_len); > if (addrs =3D=3D NULL) { > + errno =3D ENOMEM; > return (-1); > } > addrs->sget_assoc_id =3D id; > @@ -777,6 +778,7 @@ sctp_sendx(int sd, const void *msg, size > } > buf =3D malloc(len); > if (buf =3D=3D NULL) { > + errno =3D ENOMEM; > return (-1); > } > aa =3D (int *)buf; > @@ -1052,7 +1054,7 @@ sctp_sendv(int sd, > CMSG_SPACE(sizeof(struct sctp_authinfo)) + > (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); > if (cmsgbuf =3D=3D NULL) { > - errno =3D ENOBUFS; > + errno =3D ENOMEM; > return (-1); > } Both calloc(3) and malloc(3) should set errno to ENOMEM for you, so all those three are redundant. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --ZcSDOt7TZFizttpn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCWZIwACgkQForvXbEpPzSJ+ACeKYY0NnH1FrVKW50/j7MWWaYJ YisAoJS6rQ1ttw+0/rD2UhPrGIU6rIwG =nf7n -----END PGP SIGNATURE----- --ZcSDOt7TZFizttpn--