From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 360C5385841A for ; Mon, 7 Nov 2022 16:19:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 360C5385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667837967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0d34NtTtFr+9YWGJwitAEVcuAfTwVPQ+tU1GMzvgZ4w=; b=D1y/R9wY5sbDxfbUAzScZVy+WERXo/TCzROvvzXoCJI4IVPc2zCSFdX0dB6XUqJO+NFIkk P37ABk3XWSKGeOG2cX/CfNusb1+q/2Wfqa0/NkWIUiNQUPwLzTAnMCSwkN4HMbjvYYbfPE rZO4AWex2mmRVQkr1pFWL/YI4yNvzZ4= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-642-bIeNcO80O_SRHb0TY8vpRg-1; Mon, 07 Nov 2022 11:19:19 -0500 X-MC-Unique: bIeNcO80O_SRHb0TY8vpRg-1 Received: by mail-ua1-f69.google.com with SMTP id 3-20020a9f2383000000b0041170b7768fso5385627uao.3 for ; Mon, 07 Nov 2022 08:19:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0d34NtTtFr+9YWGJwitAEVcuAfTwVPQ+tU1GMzvgZ4w=; b=Crdff5uqGc/Y2y3DfIsxhpuNPGCXS/ThvCOnEwLrReQbM/g78KX7h9vz2cfmwy7LJn 7KnFhp77BTnip9nKwwjBwNqlliyemqUG+0SclkWAvtK5g331Q5jyquXH7WqtfyT5YxcF 68u6ktcChD/uIAVFYaTfNoXZ/yrnussuw3M42B/F2ObjfA2o04LwekKEf1MvsNCAYmYv zq01WoHdZAhyTlm9Y+2LL2SV26+Kz7i4iDlPafKKSll/Fmc7GoT/lI4llEN0i+BfgdAx tP8DXUAUi8ETYgxEMFKIFPBKnVCKZJv84yJvlg5zB3Wq9e+X98sSTxyChnYw1yZzGhbR KjSg== X-Gm-Message-State: ACrzQf2w7pIftxNORsiBzPhE8Ft/LD0o1BKVpW0hpI7qXVNfQQrqC52p tauauIASFXY9EQSHQJDqrsliT+M6FvNBQSROOyUvX/P+K0yUEDdDsNNccuWcI1wjXLXZgOe8Max 0Si3+fjlqlxniLEAllL+r6c6jLMhTGsAN2YtlBnxW X-Received: by 2002:a05:6102:14aa:b0:3ac:b1ee:5529 with SMTP id d42-20020a05610214aa00b003acb1ee5529mr26368131vsv.40.1667837958725; Mon, 07 Nov 2022 08:19:18 -0800 (PST) X-Google-Smtp-Source: AMsMyM5MFNE4fLxEBiKu4o8tULM6UOoEyVWyg4F/u9gNsC2pgx++kfjnn+yDYlG6iAu1Cm+O409UopgfOT1eMNKhNIM= X-Received: by 2002:a05:6102:14aa:b0:3ac:b1ee:5529 with SMTP id d42-20020a05610214aa00b003acb1ee5529mr26368113vsv.40.1667837958484; Mon, 07 Nov 2022 08:19:18 -0800 (PST) MIME-Version: 1.0 References: <20221104214018.718373-1-amerey@redhat.com> In-Reply-To: From: Aaron Merey Date: Mon, 7 Nov 2022 11:19:07 -0500 Message-ID: Subject: Re: [COMMITTED] debuginfod_find_section: Always update rc with most recent error code To: Mark Wielaard Cc: elfutils-devel@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Mark, On Mon, Nov 7, 2022 at 9:19 AM Mark Wielaard wrote: > > if (rc == -EEXIST) > > { > > - /* The section should be found in the executable. */ > > + /* Either the debuginfo couldn't be found or the section should > > + be in the executable. */ > > fd = debuginfod_find_executable (client, build_id, > > build_id_len, &tmp_path); > > if (fd > 0) > > I know this is in existing code, so this might have missed in a > previous review. But shouldn't this be fd >= 0 ? > > That is what is checked in the rest of the code. Except for the > debuginfod_find_section function which uses fd >0 twice. > > It is unlikely, but I think fd can be zero if it (stdin) was closed by > the program for some reason. Then I think zero can be reused as new > file descriptor? Thanks for catching this typo, will merge a fix. Aaron