From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E894B431FD0 for ; Fri, 3 Jun 2011 15:57:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.29 X-Spam-Level: X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] autolearn=unavailable Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zu00du2VH-ol for ; Fri, 3 Jun 2011 15:57:50 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id A4CFB431FB6 for ; Fri, 3 Jun 2011 15:57:50 -0700 (PDT) Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) by earth-doxen-postvirus (Postfix) with ESMTP id AE5E966E0380; Fri, 3 Jun 2011 15:57:46 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new Received: from servo.finestructure.net (gwave-79.ligo.caltech.edu [131.215.114.79]) (Authenticated sender: jrollins) by earth-doxen-submit (Postfix) with ESMTP id A3B1666E0398; Fri, 3 Jun 2011 15:57:43 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id C0BB5AD6; Fri, 3 Jun 2011 15:57:44 -0700 (PDT) From: Jameson Graef Rollins To: Carl Worth , Notmuch Mail Subject: Re: [PATCH 25/25] Fix stdout stream grabbing in format_part_content_text In-Reply-To: <87d3iulevu.fsf@yoom.home.cworth.org> References: <1306619520-25730-1-git-send-email-jrollins@finestructure.net> <1306619520-25730-2-git-send-email-jrollins@finestructure.net> <1306619520-25730-3-git-send-email-jrollins@finestructure.net> <1306619520-25730-4-git-send-email-jrollins@finestructure.net> <1306619520-25730-5-git-send-email-jrollins@finestructure.net> <1306619520-25730-6-git-send-email-jrollins@finestructure.net> <1306619520-25730-7-git-send-email-jrollins@finestructure.net> <1306619520-25730-8-git-send-email-jrollins@finestructure.net> <1306619520-25730-9-git-send-email-jrollins@finestructure.net> <1306619520-25730-10-git-send-email-jrollins@finestructure.net> <1306619520-25730-11-git-send-email-jrollins@finestructure.net> <1306619520-25730-12-git-send-email-jrollins@finestructure.net> <1306619520-25730-13-git-send-email-jrollins@finestructure.net> <1306619520-25730-14-git-send-email-jrollins@finestructure.net> <1306619520-25730-15-git-send-email-jrollins@finestructure.net> <1306619520-25730-16-git-se nd-email-jrollins@finestructure.net> <1306619520-25730-17-git-send-email-jrollins@finestructure.net> <1306619520-25730-18-git-send-email-jrollins@finestructure.net> <1306619520-25730-19-git-send-email-jrollins@finestructure.net> <1306619520-25730-20-git-send-email-jrollins@finestructure.net> <1306619520-25730-21-git-send-email-jrollins@finestructure.net> <1306619520-25730-22-git-send-email-jrollins@finestructure.net> <1306619520-25730-23-git-send-email-jrollins@finestructure.net> <1306619520-25730-24-git-send-email-jrollins@finestructure.net> <1306619520-25730-25-git-send-email-jrollins@finestructure.net> <1306619520-25730-26-git-send-email-jrollins@finestructure.net> <87r57almd9.fsf@yoom.home.cworth.org> <87lixihahz.fsf@servo.factory.finestructure.net> <87d3iulevu.fsf@yoom.home.cworth.org> User-Agent: Notmuch/0.6 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Fri, 03 Jun 2011 15:57:42 -0700 Message-ID: <87d3iuh6ah.fsf@servo.factory.finestructure.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2011 22:57:51 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Fri, 03 Jun 2011 15:38:29 -0700, Carl Worth wrote: > commit d5b4d950245605b84c56ce991fa3c59a073a70e5 > Author: Jameson Graef Rollins > Date: Sat May 28 14:52:00 2011 -0700 >=20 > show: Avoid inadvertently closing stdout >=20=20=20=20=20 > GMime has a nasty habit of taking ownership by default of any FILE* > handed to it va g_mime_stream_file_new. Specifically it will close the > FILE* when the stream is destroyed---even though GMime didn't open the > file itself. >=20=20=20=20=20 > To avoid this bad behavior, we have to carefully set_owner(FALSE) > after calling g_mime_stream_file_new. In the format_part_content_text > function, since commit d92146d3a6809f8ad940302af49cd99a0820665e we've > been calling g_mime_stream_file_new unconditionally, but only calling > g_mime_stream_file_set_owner(FALSE) conditionally. >=20=20=20=20=20 > This led to the FILE* being closed early when notmuch show output was > redirected to a file. >=20=20=20=20=20 > Fixing this fixes the test-suite cases that broke with the previous > commit, (which added redirected "notmuch show" calls to the test suite > to expose this bug). >=20=20=20=20=20 > Edited-by: Carl Worth with a new commit message to > explain the bug and fix. Now I sound like I know what I'm talking about! Thanks, Carl. jamie. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJN6WbmAAoJEO00zqvie6q8fUQP/2m/MOO0xkY1mX72gkQeB4xS U4niQQhIX1484t8+jCbHMtMPNwkXBA2vfxC2j2wE3tfyXfolRGDgTtJqo8SLSFx1 3GY0Jfrvsld7kK7vXzpa2anyqae0x0R0vhZMoFtR24m7CmNIl1K938MdJkJvJK0k Q96EG4lT0rwMX8OgKjPewUd7o8myhq3RnxYCZ7QOMfB5zlpbVQ6A1jiFg3pQmSXE IT/49Ik5ijVVPHAygbT3v9lZx2+IbHMDb0IlQCbu0eAQYZvOysptD4rJqA6DuM8M km/jupzszfGZ3vt1UJSdno6FGFdNN9rs5i/nvQcB7D836YFCKbB+V8lBDpQzPY+c duBimK6FogImrfR0hhn/Cf4v53dDqAk016jF+O1SDJZDiSxkboDnCr/adIV0eK/t 8ddlfMOLohwqxU1RrsYGnbrWJu60cwZsl5tJj38payd1Ijp9Du62yAAracTIrXn1 4Wi0uXrnKJg1pL09UaBtEmt2+e5bDWANDWa/KFRejBNhpJXijDuTWMimOLAFvE6c rn35GJCT1cWEaGhEYx8vDkm6hYTX9gukWhtJ7+bcWxIepoqKEFJRU1bhiAnqV9MK PfqeJ2qZTKr4Vnnfd279AT0xqzzG9mFpUkHSJmumLt52tbxz4cCpaTEceOdMAc10 sECcCwt8hC9ZW1tinHIE =UZCZ -----END PGP SIGNATURE----- --=-=-=--