Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HY8XT-0003F4-5c for qemu-devel@nongnu.org; Sun, 01 Apr 2007 18:28:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HY8XR-00037o-Mp for Qemu-devel@nongnu.org; Sun, 01 Apr 2007 18:28:42 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HY8XR-00037F-E7 for Qemu-devel@nongnu.org; Sun, 01 Apr 2007 18:28:41 -0400 Received: from smtp.gentoo.org ([140.211.166.183]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HY8US-0007gQ-ST for Qemu-devel@nongnu.org; Sun, 01 Apr 2007 18:25:37 -0400 Received: from home.wh0rd.org (pool-151-203-195-204.bos.east.verizon.net [151.203.195.204]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 91D9764A12 for ; Sun, 1 Apr 2007 22:25:33 +0000 (UTC) From: Mike Frysinger Subject: Re: [Qemu-devel] [patch] use socklen_t with getsockopt() Date: Sun, 1 Apr 2007 18:25:55 -0400 References: <200703310424.14025.vapier@gentoo.org> <20070401184302.GB29135@networkno.de> In-Reply-To: <20070401184302.GB29135@networkno.de> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_zFDEGMBBWWkGEVr" Message-Id: <200704011825.55550.vapier@gentoo.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thiemo Seufer Cc: Qemu-devel@nongnu.org --Boundary-00=_zFDEGMBBWWkGEVr Content-Type: multipart/signed; boundary="nextPart1857568.L92TfENDzl"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1857568.L92TfENDzl Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sunday 01 April 2007, Thiemo Seufer wrote: > Mike Frysinger wrote: > > obvious fixup ... getsockopt() takes a socklen_t, not an int > > This is incorrect. Its initial value is sizeof(val). attached -mike --nextPart1857568.L92TfENDzl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (GNU/Linux) iQIVAwUARhAxc0FjO5/oN/WBAQIOMg/7B0+YtDAiU21djm0/9cgT98SkAW97ADm/ 6qfcjlMJZUe0qdL5bx3UIFHYZKcTYYUzD32D1NOF10X4Ft/sVjEJldxiTKFiYxg+ KxyK+JYbzkJ8hDZY/jZqim5CUJbBRLocp/dLryiZCFxdMZ+ATPsbX20oWfzZbvUg wX5hEULst4dsjwFLY6WwJGR8jctqkR/ssE3v5HOzzeFx0GAkBkuhnJvHH6UEbiHj wWxWm+hpX9fgwoz05h2t95Txsgi1OQxEP4aLYRd6meMicc59G+8RiQwQtZk+ruiL QvLWOlwQy3E05PszCVbPsyqloMsgI2ClVOB13skMrmXK/wWJPASBrtMeB06AAavi LIBmVvHihzu+sGsiAwqEZuv8kVihIwdkZbgvSEGmNhrwzbY3VPWS5D1KR/bI3oAR TJjkuId0ES3icRZ0ZK5tW4kjtt2+nSpXP4Dyr2Y6FEp+ElfnG4OhQ1JWBREms6ww BYPdqVKVMTIPpXCatXA051lAmV9nc/bxXUC98owDbtSNc4TDiGuVbXcTuotfvUUP RovKdj8tnunmqDuxa57E7h3SSyjs+RzTLhfydDoXGpSKgoThG1hC5Md8KHekIZMx V4D1Rqpsn/r4Qjp9PqE9ZJqRblvReIXW+7yCBTN80+8oPzcbpSpqn7pf4NuElfSO NvnKC2hGerw= =3QvR -----END PGP SIGNATURE----- --nextPart1857568.L92TfENDzl-- --Boundary-00=_zFDEGMBBWWkGEVr Content-Type: text/x-diff; charset="iso-8859-1"; name="qemu-socklen-t.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-socklen-t.patch" --- linux-user/syscall.c +++ linux-user/syscall.c @@ -642,7 +642,8 @@ static long do_setsockopt(int sockfd, in static long do_getsockopt(int sockfd, int level, int optname, target_ulong optval, target_ulong optlen) { - int len, lv, val, ret; + int len, val, ret; + socklen_t lv; switch(level) { case TARGET_SOL_SOCKET: @@ -665,7 +666,7 @@ static long do_getsockopt(int sockfd, in len = tget32(optlen); if (len < 0) return -EINVAL; - lv = sizeof(int); + lv = sizeof(val); ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv)); if (ret < 0) return ret; @@ -698,7 +699,7 @@ static long do_getsockopt(int sockfd, in len = tget32(optlen); if (len < 0) return -EINVAL; - lv = sizeof(int); + lv = sizeof(val); ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv)); if (ret < 0) return ret; --Boundary-00=_zFDEGMBBWWkGEVr--