From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7910) id C22753858C52; Fri, 15 Sep 2023 22:03:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C22753858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694815389; bh=wKa744XFdS83nvoxu0iDqwFCitfHUd60mPTB6TLxDFI=; h=From:To:Subject:Date:From; b=HgG+Rmcw5O71f9L4OdrMwvdeWFUACUfiwNfXr+Rvyo3HVN/lueKp7uIRiOTR553tN 3o0rLFqK8mEf+2nNayPBlJK5i+G7b3PAqxiZJ9t6SoVL/79wJ8vKdRxLFMneB6gPpV m1IC6cVPxNKO+PBtUDTixQXDzl4gHxsxujCj64NQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Andreas K. Huttel To: glibc-cvs@sourceware.org Subject: [glibc/release/2.38/master] iconv: restore verbosity with unrecognized encoding names (bug 30694) X-Act-Checkin: glibc X-Git-Author: Andreas Schwab X-Git-Refname: refs/heads/release/2.38/master X-Git-Oldrev: 00ae4f10b504bc4564e9f22f00907093f1ab9338 X-Git-Newrev: 63250e9c571314b6daa2c949ea0af335ee766751 Message-Id: <20230915220309.C22753858C52@sourceware.org> Date: Fri, 15 Sep 2023 22:03:09 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=63250e9c571314b6daa2c949ea0af335ee766751 commit 63250e9c571314b6daa2c949ea0af335ee766751 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. (cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d) 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