From patchwork Tue Aug 1 15:07:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 73431 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D5283858425 for ; Tue, 1 Aug 2023 15:08:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D5283858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690902483; bh=Yp6me7pBJP6JaM3H8ZQBQ4FZQAFAA7xYqEe9VnjvNTM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=VHWGZfJVMPHP6NRiho3yWKR7K1ge1yn/y8H4Mz7bwyqLQVJbhs0P2AeAJe/zb9R2B Y3g1zzQS+y78MOYGgCN43UdVXB8xVkt9yjbxsTHkPKsln45cO+Jh9voEaBFA4tzwUh Baigt/aIvHQwd0447LlssYYDrLHbzk4wSIoUioDs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 970383858C2B for ; Tue, 1 Aug 2023 15:07:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 970383858C2B Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id C09982188E for ; Tue, 1 Aug 2023 15:07:31 +0000 (UTC) Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id B6D5E2C142 for ; Tue, 1 Aug 2023 15:07:31 +0000 (UTC) Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id A65864A0501; Tue, 1 Aug 2023 17:07:31 +0200 (CEST) To: libc-alpha@sourceware.org Subject: [PATCH] iconv: restore verbosity with unrecognized encoding names (bug 30694) X-Yow: Hello. Just walk along and try NOT to think about your INTESTINES being almost FORTY YARDS LONG!! Date: Tue, 01 Aug 2023 17:07:31 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andreas Schwab via Libc-alpha From: Andreas Schwab Reply-To: Andreas Schwab Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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. Reviewed-by: Arjun Shankar --- 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