Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 5B6F04196F0 for ; Thu, 1 Apr 2010 07:31:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -5.001 X-Spam-Level: X-Spam-Status: No, score=-5.001 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, RCVD_IN_DNSWL_HI=-5] autolearn=ham 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 9RwxGa7hagt3 for ; Thu, 1 Apr 2010 07:31:17 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by olra.theworths.org (Postfix) with ESMTP id 8C1B7431FC1 for ; Thu, 1 Apr 2010 07:31:17 -0700 (PDT) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o31EVEFY029959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Apr 2010 10:31:14 -0400 Received: from tin.rawstew (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o31EVD5v009098; Thu, 1 Apr 2010 10:31:14 -0400 Received: by tin.rawstew (Postfix, from userid 10119) id 38D86506C5; Thu, 1 Apr 2010 10:31:13 -0400 (EDT) Date: Thu, 1 Apr 2010 10:31:13 -0400 To: Michal Sojka Message-ID: <20100401143113.GE25669@redhat.com> References: <20100401134721.GD25669@redhat.com> <87wrwr45k5.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wrwr45k5.fsf@steelpick.2x.cz> User-Agent: Mutt/1.5.20 (2009-08-17) From: nstraz@redhat.com X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Cc: notmuch@notmuchmail.org Subject: Re: [notmuch] [PATCH] Setup the GMimeStream only when needed 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: Thu, 01 Apr 2010 14:31:18 -0000 On Apr 1 16:21, Michal Sojka wrote: > On Thu, 01 Apr 2010, nstraz@redhat.com wrote: > > I ran into this while looking at the vim plugin. Vim's system() call > > redirects output to a file and it was missing many of the part{ lines. > > > > If stream_stdout is setup too early, it will overwrite the part start > > when notmuch is redirected to a file. > > thanks for the patch. After some investigation, it seems that you are > right. What I missed in your commit message is the reason for such > behaviour i.e. GMimeStream fseek()s in its write method to the position > recorded when the stream was created, so that in case there is somebody > else writing to the stream, the writes may overlap. Right, and in the case of writing to a pipe, the seek fails and the file position doesn't change. I found it comparing strace output of `notmuch show ... > file` and `notmuch show ... | cat > file.` Nate