From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id AE59D384D159 for ; Thu, 20 Oct 2022 18:27:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE59D384D159 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x432.google.com with SMTP id i3so314457pfc.11 for ; Thu, 20 Oct 2022 11:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pV5k9XjtNM91HPNi81oJ1S+WElUoK9vHeUZhFdZgpn4=; b=aK5XJqfwAJCadpGl0Bep3eAuLY4Calnnbb919YezOtsD2a/+Cz2lYSu299wy8bvPf3 S8yBURzNhwjiaEww+bMSmhL8B4+eArw6UTWIbTG58Vw/xuXIsjDnfFp5HaA6HeTcpx1L M9DaO4H67ice2yAkd5MDYVIZGQ+3Ke/StBBkECiCngNPYIAFnxqCe6rICmIqDn4Xl6QA GacpnwHcW+G5HAnMD+ZLC8aWXCTAicp+1pHy+fdoyP805EjoDitXrkFvfJ4kvZOF7KiL s51bYcm5rWAvPBMTW3mYUn4dgDKaF8DXKT6SUOvn+IjCi5gH/Fahl3RxQQkZqb4QzKNg 56ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pV5k9XjtNM91HPNi81oJ1S+WElUoK9vHeUZhFdZgpn4=; b=A15g3syDXi4YMX0b2hf+QPMZ6+SJU50bin8iacaEVFRJE0qIkuA65N6VuarXHzTxxz pn5KrsIUYsHtMSz6PCWoY2q3uSZ3kBZe9s0k7QJsKqohVsMhFJDj2uW1RdZPobyUTkZQ JgjPs9KozMVR0mxVt8isLUVlzpq9935niaj70ZWf7lymVyracieFfrYqffAJSYSJPYY4 NBZ3IEsIPfy8OfGFmeLhH4O6w+hrgCmnZt4l8/V5h3t+f26Yj+r62VK+Ptls4sPjmvLt aW20jO05EArK/1fn4aupw6dclrO5Hsjk1lg3MbI9Kw5l3OFKB/ZBuYqFGJ/Ada7feQyb H22w== X-Gm-Message-State: ACrzQf0eReTJlF/4tJYQXSNPgEdA24xPC7x54Muh1AQPuTQybvQi+hP+ WWPWBjL+ZpInIlAfHY0qtZBzxptq1K4zPg== X-Google-Smtp-Source: AMsMyM4JZwtLiC2iOfG+zfj+RxT5fVqZAuU7xp1TlRNR03aA7YQv1/bTeAj70HleeGBv/wFEZtqnEQ== X-Received: by 2002:a65:6d89:0:b0:421:94bc:cb89 with SMTP id bc9-20020a656d89000000b0042194bccb89mr12770264pgb.129.1666290423979; Thu, 20 Oct 2022 11:27:03 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id w15-20020a17090a460f00b00202fbd9c21dsm115067pjg.48.2022.10.20.11.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 11:27:03 -0700 (PDT) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH 19/25] libelf: F_GETFD may not predefined with msvc/mingw, guard the usage of it Date: Fri, 21 Oct 2022 02:25:58 +0800 Message-Id: <20221020182603.815-20-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221020182603.815-1-luoyonggang@gmail.com> References: <20221020182603.815-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: Signed-off-by: Yonggang Luo --- libelf/elf_begin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index 6d31882e..d867cd6f 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_begin.c @@ -1163,12 +1163,14 @@ elf_begin (int fildes, Elf_Cmd cmd, Elf *ref) if (ref != NULL) /* Make sure the descriptor is not suddenly going away. */ rwlock_rdlock (ref->lock); +#if defined(F_GETFD) else if (unlikely (fcntl (fildes, F_GETFD) == -1 && errno == EBADF)) { /* We cannot do anything productive without a file descriptor. */ __libelf_seterrno (ELF_E_INVALID_FILE); return NULL; } +#endif switch (cmd) { -- 2.36.1.windows.1