From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id C47A51F66E for ; Wed, 12 Aug 2020 20:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbgHLU20 (ORCPT ); Wed, 12 Aug 2020 16:28:26 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:59270 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbgHLU20 (ORCPT ); Wed, 12 Aug 2020 16:28:26 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 8551E70507; Wed, 12 Aug 2020 16:28:23 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=cDwDEo9R1ZXR CPQWKAmUDW2iX58=; b=SI0rqFnVjNnz95ROLGsJcY/wVSmgSuROX3CpA9CIO5vE rgINBH+TapdfyjXMCFm5E9hc1+cSQ8DO7HzWyqAkugdfetuvpaWu3GmMSnmGjiCt TkOmMJYiDP3k/qdqbb+zzYvXeFyKrYUYixbBgV2rrrrA5PH2BN8CWVZxFcUvq0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=lUDfp4 tUXWHnd2Brfql/aQHOhG8qsY+ScsnGAnpOZWZH1aBNGgPPH2bxkJrC/JT2F8cAx0 gly8pvNAOijXyyQ+eHmQ5t0v56+W+VL1hvw1DXSLFVCc+3ZZkqRnNynBUlYLHJBK iMGllZuBdv6mJeUoQM+6u2Ff57lHExBacnh10= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 7D83C70506; Wed, 12 Aug 2020 16:28:23 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.196.173.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 03DE270505; Wed, 12 Aug 2020 16:28:22 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?Q?Ren=C3=A9?= Scharfe Cc: Git Mailing List , Chris Torek , Johannes Sixt , Derrick Stolee Subject: Re: [PATCH v2] midx: use buffered I/O to talk to pack-objects References: <9162c1cb-36fd-3203-ec58-4bd1501938d0@web.de> Date: Wed, 12 Aug 2020 13:28:22 -0700 In-Reply-To: <9162c1cb-36fd-3203-ec58-4bd1501938d0@web.de> (=?utf-8?Q?=22R?= =?utf-8?Q?en=C3=A9?= Scharfe"'s message of "Wed, 12 Aug 2020 18:52:54 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 5E3E2E46-DCDA-11EA-B3D3-2F5D23BA3BAF-77302942!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Ren=C3=A9 Scharfe writes: > nth_midxed_object_oid(&oid, m, i); > - xwrite(cmd.in, oid_to_hex(&oid), the_hash_algo->hexsz); > - xwrite(cmd.in, "\n", 1); > + fprintf(cmd_in, "%s\n", oid_to_hex(&oid)); I do think it is silly to send an object name and terminating LF in two different system calls per object. The original uses xwrite() so that it does not have to worry about having to restart interrupted system calls and such. Do we need to do that ourselves now or does the stdio layer take care of it for us? > } > - close(cmd.in); > + fclose(cmd_in); > > if (finish_command(&cmd)) { > error(_("could not finish pack-objects")); > -- > 2.28.0