From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2138) id 19F9F3858D1E; Wed, 2 Aug 2023 11:30:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19F9F3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690975824; bh=tRM8BfSQc6fS1r1wDMr7KhJOBTUBd6GVMvExn/yyh+I=; h=From:To:Subject:Date:From; b=S3DuWs9WNZsbGjkqLayXkYjEiPSa0uiKZA+09RTEzt5BtOu35YkEyJrUbRtFzSBz7 4PVmpfQJcBIf/jnUCP3OFzioz29iYKJoilBjR+R5ZspAQi12wHJ+R4SGJEKMXEJZBU tsFN5MiXZolsSUzw3W7U12i2j6qg6EXv5AS7gxrw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Andreas Schwab To: glibc-cvs@sourceware.org Subject: [glibc] iconv: restore verbosity with unrecognized encoding names (bug 30694) X-Act-Checkin: glibc X-Git-Author: Andreas Schwab X-Git-Refname: refs/heads/master X-Git-Oldrev: 78ceef25d64efeeb6067d1cb282a00466e637e2a X-Git-Newrev: fc72b6d7d818ab2868920af956d1542d03342a4d Message-Id: <20230802113024.19F9F3858D1E@sourceware.org> Date: Wed, 2 Aug 2023 11:30:24 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fc72b6d7d818ab2868920af956d1542d03342a4d commit fc72b6d7d818ab2868920af956d1542d03342a4d Author: Andreas Schwab Date: Tue Aug 1 17:01:37 2023 +0200 iconv: restore verbosity with unrecognized encoding names (bug 30694) 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. Diff: --- 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