From nobody Tue Feb 10 22:18:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516799208506459.4356396681085; Wed, 24 Jan 2018 05:06:48 -0800 (PST) Received: from localhost ([::1]:47788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeKlH-0006X7-J0 for importer@patchew.org; Wed, 24 Jan 2018 08:06:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeKgg-0003H6-2o for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:02:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeKgf-0005gZ-8i for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:01:58 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:40830) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeKgf-0005fz-4r for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:01:57 -0500 Received: by mail-qt0-x242.google.com with SMTP id s39so10009075qth.7 for ; Wed, 24 Jan 2018 05:01:56 -0800 (PST) Received: from x1.lan ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id q26sm2037495qtl.68.2018.01.24.05.01.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 05:01:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JUh9AP/n7y7y5hb9P6Pb3qfCeXAbic7oFxWACLHJY5A=; b=EtzoI/48ZQACTkleqsrPtdDwozdFgbJbXLQf6r66S0eW5qEdpvvy8T2esuURGsUFn2 6BRizYd1TBjZLXY/nU4QXaJ1gC4tQCxjK7A33eJQBZAljX0WOf6IOtM2UWS/4Aom45GY nuxLwqxeLroVT9vNhZoXrLrZzqimRJ61Iu2FmZZb01ewtNPAyuYFemOxWeME/dWomIQn uNXSKyJnCONjXwh5Vvlkcp12dYgjHPwKLZOPCFfEtBMo/mkNIZQ7bVtvJneOD0Mrg64x pPeoglDX8IOKUT3q9+LDGsUm0Q/CZTkShuZdwYf6nk3GpuMZxDlwKSjom99RDAVVOd22 0o6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JUh9AP/n7y7y5hb9P6Pb3qfCeXAbic7oFxWACLHJY5A=; b=k1GrOY/+EAsY6glAnWr4Vyu3jxsq1BKo9A6wtQ9ZinSXSHtlgEWw8TBW4emY+arDH7 tuoeeaGcc+bRT4W4z4lqS2mgU0DyEb71B1a4glS1Vs5m6olnEtZEV3qNuFBjhFX3uRfo Z7txFalt/GvuKt/mqwGGX0bpghgLx8Y2BRjK4QjkJ6LQY77elaYidhWdVuRbyJvdT5H1 rmcVlVGPJzV07+0XRBtDriH+VrVBn/qVMaTxBMKh0jUyJUdxnj93NvCkzypxl6jwnrbq JOLL7c5ZeNfNACfCI2i3wm4/kMmxGT4uoNSHV93Hzck8/DKoREiftYl3mgaXSTXzyrPp yi5g== X-Gm-Message-State: AKwxytfN/+8T1yavF7NWfDSaLwPv8tVeHIBpNQNChof90GyFUdXVPb43 QB75Tjlv+9/eBaMCcv0/Sl8= X-Google-Smtp-Source: AH8x227TCQLnVeUliinK9qkRCFKIOXBoXbb4MLyCasL1IA62dRs8+JDVdarzM9B8NwJ7Tat2wMj40A== X-Received: by 10.55.7.2 with SMTP id 2mr9668638qkh.244.1516798916328; Wed, 24 Jan 2018 05:01:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Riku Voipio , Laurent Vivier Date: Wed, 24 Jan 2018 10:01:26 -0300 Message-Id: <20180124130126.20871-12-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180124130126.20871-1-f4bug@amsat.org> References: <20180124130126.20871-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 11/11] linux-user/syscall: simplify recvfrom() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Guido=20G=C3=BCnther?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- linux-user/syscall.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b6b9beca5b..e082af2911 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4023,8 +4023,8 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, si= ze_t len, int flags, abi_ulong target_addr, abi_ulong target_addrlen) { - socklen_t addrlen; - void *addr; + socklen_t addrlen =3D 0; + void *addr =3D NULL; void *host_msg; abi_long ret; =20 @@ -4046,12 +4046,9 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, s= ize_t len, int flags, } =20 addr =3D alloca(addrlen); - ret =3D get_errno(safe_recvfrom(fd, host_msg, len, flags, - addr, &addrlen)); - } else { - addr =3D NULL; /* To keep compiler quiet. */ - ret =3D get_errno(safe_recvfrom(fd, host_msg, len, flags, NULL, 0)= ); } + ret =3D get_errno(safe_recvfrom(fd, host_msg, len, flags, addr, &addrl= en)); + if (!is_error(ret)) { if (fd_trans_host_to_target_data(fd)) { ret =3D fd_trans_host_to_target_data(fd)(host_msg, ret); --=20 2.15.1