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 8DCAF431FC0 for ; Wed, 23 Jan 2013 00:26:47 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled 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 1WgUbHcXZRpP for ; Wed, 23 Jan 2013 00:26:43 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 5B163431FAE for ; Wed, 23 Jan 2013 00:26:43 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 41C2E100086; Wed, 23 Jan 2013 10:26:31 +0200 (EET) From: Tomi Ollila To: Peter Wang , Jani Nikula Subject: Re: [PATCH v3 01/20] cli: add stub for insert command In-Reply-To: <20130123190424.GA1980@hili.localdomain> References: <1358643004-14522-1-git-send-email-novalazy@gmail.com> <1358643004-14522-2-git-send-email-novalazy@gmail.com> <87vcaoj3i0.fsf@nikula.org> <20130123190424.GA1980@hili.localdomain> User-Agent: Notmuch/0.15+11~ge1e719d (http://notmuchmail.org) Emacs/24.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain Cc: notmuch@notmuchmail.org 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: Wed, 23 Jan 2013 08:26:47 -0000 On Wed, Jan 23 2013, Peter Wang wrote: > On Tue, 22 Jan 2013 23:45:43 +0200, Jani Nikula wrote: > >> > +/* Copy the contents of standard input (fdin) into fdout. */ >> > +static notmuch_bool_t >> > +copy_stdin (int fdin, int fdout) >> >> The comment and the function name imply the function has something to do >> with stdin, while it only cares about file descriptors. > > Tomi pointed out that the error message refers to standard input. Was that me or some other Tomi ;)... Nevertheless the function here called 'copy_stdin' copies fdin to fdout, whatever the file descriptors are, it doesn't enforce fdin to be fd 0 (default stdin). I.e. the function name should be more generic (or then drop fdin argument -- should better name then be 'copy_from_stdin' or copy_stdin_to.. or copy_[from_]stdin_to_some_magic_fd -- ok, no more bikeshedding now >;)). > Peter Tomi