From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6222 invoked from network); 8 Oct 2020 15:50:55 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 8 Oct 2020 15:50:55 -0000 Received: (qmail 22078 invoked by uid 550); 8 Oct 2020 15:50:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13725 invoked from network); 8 Oct 2020 14:56:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1602168954; bh=042zxHZgTlanTPWu2AAL0nnnr9oWKqhyriOrPOQznTk=; h=From:To:Subject:Date:From; b=YIBnMinJGHHP00OkZA83oedBEWiMCg/RD94AemwI+KXsPFV3s0Lqz0z0dCoxIbkC6 dxwNyu06bpbWUqye2x1qX85G6UjuEHD9OWFVDO1z6a3dl2MsBNUAZy01yHHeupSa6a 0uo46uvWpy9wdaAcab6Os1P90dn7hTe6lGPuV67uhudZVROHbaTSPNH/4nw+FiDRr6 hAV1zOTCBHSyW3OKygusP7q5t4UovQemsgu2AHCThE9aWOtPlqiyv6QWfrpIfNs5gF QiFoQ1cg+1vFAAltuI4WRpfjvLh+mz3YoOrve3mLexh8rtLNjeyhMEjYvEdOewGS+7 SqERxBz6E4XKw== From: John Scott To: musl@lists.openwall.com Date: Thu, 08 Oct 2020 10:55:47 -0400 Message-ID: <20475045.GjpEljjT90@t450> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3495775.ZKrqyvnO16"; micalg="pgp-sha256"; protocol="application/pgp-signature" Subject: [musl] fputs/fputc doesn't set errno on failure --nextPart3495775.ZKrqyvnO16 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, I'm not subscribed, please keep me CC'd. In this corner case, errno is unset despite fputs giving an error. I'm on Debian testing using musl-gcc 1.2.1. #define _POSIX_C_SOURCE 200809L #include #include #include int main(void) { FILE *f = fopen("/", "r"); if(f == NULL) { perror("fopen()"); } if(fputs("Hello world\n", f) == EOF) { assert(errno); perror("fputs()"); } } With glibc this prints EBADF for fputs. The wiki page about writing tests [1], which I thought this would be a good candidate for, has the 404 link http://nsz.repo.hu/git/?p=libc-test Please let me know if I can help debugging. [1] https://wiki.musl-libc.org/writing-tests.html --nextPart3495775.ZKrqyvnO16 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQT287WtmxUhmhucNnhyvHFIwKstpwUCX38ocwAKCRByvHFIwKst p4GuAQDGd7wD+kiVuxQPwtvWnYvin9lCzs+9/A+6lLh36dfi2QEAyOpYUn907btE NE62OQQgP5JEWmLoSSW8LxMOPgJLUQs= =vQ4Z -----END PGP SIGNATURE----- --nextPart3495775.ZKrqyvnO16--