Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2921187rdd; Sat, 13 Jan 2024 07:19:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0PpIW+cAY0q3SKHWvElbJln9q0xMX69bEdWbk3Moo1WNpv3dfU91CxGdxJTCiYP1PmcRL X-Received: by 2002:a17:906:fd81:b0:a28:fb94:b773 with SMTP id xa1-20020a170906fd8100b00a28fb94b773mr945982ejb.223.1705159183258; Sat, 13 Jan 2024 07:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705159183; cv=none; d=google.com; s=arc-20160816; b=gTs3IwVkjCfFIPfRmUwWxHN/tPmiKKyR+3KzcVutuRiW9qss6X0wPPXy+KjBs8UBXi wT5ye/GeXtOa1YN3KYLQ4ToHe5GzqpJQ6ap1rBmRrhYkS2m5N7mMQl+mYGHCYxiSc0Jz RRXe6kgkU8lgTbmJJDbPVbMJ6yph9hHGJy6BjdLETgY1JDev+GRIbQgCZDqaM8ITUXsy 7kxpdqu1/vaKmgRW2yBVge1DrbZmV+74s1Ty3JmVYUjO/NVlRQ3IO7AQ5WKHl+HZdnZI wfy+suZxUCWnXAqSvRMjBgFa7hcwzqBBb+1MUHMDld+hq2vZyiAQfXQAPZOb5gR2yZf7 E3XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=5J+GX46J7ydw228ILKPb9NFjnt24HexzNMmlnaOhJK8=; fh=//+2cTEgcnm/nhcKhEezeBLrqtvifmIIqwZlBvaOsjI=; b=ZHPZWGoA+4h4MCLaRuIUHqgCBEmDVHcuL4hQLEVDHgH2pKkdnCjOZKa1DvfiWZ8pq7 yCD390ywB9S43gzhbvO2gQaJ+T4Rbvb/bLUZVWLAvJb9eNX6ROSKtCkNsrNNkSxQTZvn wE65Ai6X1QHq1Jwvlj8vX9d8OzYNOmCWDt4FBbMckk4Zqt9cjKST4HQF3UcjNRFiI70g JGrbb1LysY8yqQ7IgG/Rzm5SdzeN0dny438bc6s1rN/yBa6oc3XFo/WdMskAR5al9MfI ZyKzErA/o0LsyvHLfYzMtjwB/kkDdrSfdWn1NS2bv1gvTiqYf93Lvdh9ahMLUAiAfp8E JHBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hxNE8PlW; spf=pass (google.com: domain of linux-kernel+bounces-25319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g9-20020a170906394900b00a2afed17e93si2298726eje.191.2024.01.13.07.19.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 07:19:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hxNE8PlW; spf=pass (google.com: domain of linux-kernel+bounces-25319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F0D971F22923 for ; Sat, 13 Jan 2024 15:19:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B118B1C20; Sat, 13 Jan 2024 15:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hxNE8PlW" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E722DEBB; Sat, 13 Jan 2024 15:19:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ED11C433C7; Sat, 13 Jan 2024 15:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705159173; bh=vX58YZjenHiTJxtX2xEHIR6mIG6Zrsa+Iez23OxTdYQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hxNE8PlWdaMQ+h0z1BW/rJFuaHHcWOXuAYK0ApWFH3ZXaa50jiMnU9BWvFb7VL0W6 nXwtZ0of5I153SdWFROj1PsSXRC+KNINlFgaGfexdky1wWWiB1FBSPMT1wbN7YJMga diR1DMQZ/EdEDruwKGke73ZibkCUegQ77y7EL0ZHNRgU1JoQpqTDs90Uo+Ri+AjYbG xIL0/JilNQX/jOJu/2XoapGCqiLLyx+rKIXTEL6Lh5xr8FwtrTz2U+AMUYlMKbsZdS 1K/GLQDsufrVKpMeln9ryW/YLUlz9JqQbZDOCxGNCM3FczfIFTQFm7ML7LGJ97yBqD L07s381i7Bs8A== Date: Sat, 13 Jan 2024 15:19:28 +0000 From: Jonathan Cameron To: Petre Rodan Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen Subject: Re: [PATCH 1/1] tools: iio: replace seekdir() in iio_generic_buffer Message-ID: <20240113151928.0857a93a@jic23-huawei> In-Reply-To: <20240108103224.3986-1-petre.rodan@subdimension.ro> References: <20240108103224.3986-1-petre.rodan@subdimension.ro> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.39; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 8 Jan 2024 12:32:20 +0200 Petre Rodan wrote: > Replace seekdir() with rewinddir() in order to fix a localized glibc bug. > > One of the glibc patches that stable Gentoo is using causes an improper > directory stream positioning bug on 32bit arm. That in turn ends up as a > floating point exception in iio_generic_buffer. > > The attached patch provides a fix by using an equivalent function which > should not cause trouble for other distros. > > https://sourceware.org/bugzilla/show_bug.cgi?id=31212 > > Signed-off-by: Petre Rodan I tweaked the description a tiny bit to say it's also easier to reason about in general. Applied to the togreg branch of iio.git and pushed out as tesing for 0-day to probably ignore it. Thanks, Jonathan > --- > tools/iio/iio_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c > index 6a00a6eecaef..c5c5082cb24e 100644 > --- a/tools/iio/iio_utils.c > +++ b/tools/iio/iio_utils.c > @@ -376,7 +376,7 @@ int build_channel_array(const char *device_dir, int buffer_idx, > goto error_close_dir; > } > > - seekdir(dp, 0); > + rewinddir(dp); > while (ent = readdir(dp), ent) { > if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), > "_en") == 0) { > -- > 2.41.0 >