X-Envelope-From: notmuch-bounces@notmuchmail.org  Sat Apr  4 07:08:09 2026
Return-Path: <notmuch-bounces@notmuchmail.org>
X-Original-To: nmbug@yantan.tethera.net
Delivered-To: nmbug@yantan.tethera.net
Received: from yantan.tethera.net (localhost [127.0.0.1])
	by mail.notmuchmail.org (Postfix) with ESMTP id 505DD60509;
	Sat,  4 Apr 2026 07:08:09 +0000 (UTC)
Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1])
	by mail.notmuchmail.org (Postfix) with ESMTPS id DAD615F813
	for <notmuch@notmuchmail.org>; Sat,  4 Apr 2026 07:08:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tethera.net;
 i=@tethera.net; q=dns/txt; s=2024; t=1775286482; h=from : to : subject
 : in-reply-to : references : date : message-id : mime-version :
 content-type : from; bh=Uqqlo2SOSlyjS+i4BbzlggdVCjnGeEc1SBKt9tWQ+g8=;
 b=W6f65zydkDgx6DNJip3sH3VMy581ww55TrtJVy6s3J5J4fg/9W7gl48iF5BZU8iLP9NoT
 fDaHMt+vopIKMXb0YumXFxXJJHytkjxygDfvKd7yneEzo8HRI8PkYLD0Y0+W/06rKTUgjLy
 rzaKM9XzwIoCeqH3oRbdgdIRHRVEHwRXZl9OMptq8krXOLZJaEeEN0FnXCZviWUdsZXObvp
 cXrSAGj5k5tNivwt0yMI6L8WbRxFgRfHFlGw8olgcZNRpt0wsKkU1+rP0hiIumSPn7d2wHk
 QuxkOqDO6BloQuC71s7OsIu6+FImJilhWdI8+r6MEq8leV0eInnmvH84r3XA==
Received: from tethera.net (M111108027213.v4.enabler.ne.jp [111.108.27.213])
	by phubs.tethera.net (Postfix) with ESMTPS id 1DFDB1800F7;
	Sat, 04 Apr 2026 04:08:01 -0300 (ADT)
Received: (nullmailer pid 1033951 invoked by uid 1000);
	Sat, 04 Apr 2026 07:07:59 -0000
From: David Bremner <david@tethera.net>
To: Anton Khirnov <anton@khirnov.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH v4 2/6] index: implement filtering attachments with an
 external program
In-Reply-To: <20260307160342.16482-3-anton@khirnov.net>
References: <20260307160342.16482-1-anton@khirnov.net>
 <20260307160342.16482-3-anton@khirnov.net>
Date: Sat, 04 Apr 2026 16:07:59 +0900
Message-ID: <878qb39p9s.fsf@tethera.net>
MIME-Version: 1.0
Message-ID-Hash: A2PY4M4WXPS3YD6SZTLGTZIHNJFXKKR2
X-Message-ID-Hash: A2PY4M4WXPS3YD6SZTLGTZIHNJFXKKR2
X-MailFrom: david@tethera.net
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.3
Precedence: list
List-Id: "Use and development of the notmuch mail system." <notmuch.notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Owner: <mailto:notmuch-owner@notmuchmail.org>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Subscribe: <mailto:notmuch-join@notmuchmail.org>
List-Unsubscribe: <mailto:notmuch-leave@notmuchmail.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Anton Khirnov <anton@khirnov.net> writes:

> +
> +	flags |= O_NONBLOCK;
> +	ret = fcntl (pipes[i], F_SETFL, flags);
> +	if (ret == -1) {
> +	    _notmuch_database_log (db, "Error making the pipe non-blocking: %s\n",
> +				   strerror (errno));
> +	    goto CLOSE;
> +	}
> +    }
> +
> +    _filter_attachment_communicate (&pipes[0], &pipes[1],
> +				    &data, &data_len, db);

I hesitate to mention it, but I think this could reasonably be one line.

I was also annoyed by

>      body = (char *) g_byte_array_free (byte_array, false);
>  

But I realized I probably wrote it ;).

d

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org
