From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id AF2393858C54 for ; Fri, 15 Sep 2023 22:02:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF2393858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= To: libc-stable@sourceware.org Cc: Andreas Schwab Subject: [PATCH 1/3] iconv: restore verbosity with unrecognized encoding names (bug 30694) Date: Sat, 16 Sep 2023 00:01:27 +0200 Message-ID: <20230915220242.2825510-2-dilfridge@gentoo.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230915220242.2825510-1-dilfridge@gentoo.org> References: <20230915220242.2825510-1-dilfridge@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,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: From: Andreas Schwab Commit 91927b7c76 ("Rewrite iconv option parsing [BZ #19519]") changed the iconv program to call __gconv_open directly instead of the iconv_open wrapper, but the former does not set errno. Update the caller to interpret the return codes like iconv_open does. (cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d) --- iconv/iconv_prog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c index bee898c63c..cf32cf9b44 100644 --- a/iconv/iconv_prog.c +++ b/iconv/iconv_prog.c @@ -187,7 +187,7 @@ main (int argc, char *argv[]) if (res != __GCONV_OK) { - if (errno == EINVAL) + if (res == __GCONV_NOCONV || res == __GCONV_NODB) { /* Try to be nice with the user and tell her which of the two encoding names is wrong. This is possible because -- 2.41.0