From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32540 invoked from network); 15 Feb 2021 08:20:13 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 15 Feb 2021 08:20:13 -0000 Received: from outgoing.selfhost.de ([82.98.82.6]) by 1ess; Mon Feb 15 03:16:00 -0500 2021 Received: (qmail 21413 invoked from network); 15 Feb 2021 08:15:40 -0000 Received: from unknown (HELO mx03.bss-wf.de) (postmaster@emdtgvmf.mail.selfhost.de@84.150.39.186) by mailout.selfhost.de with ESMTPA; 15 Feb 2021 08:15:40 -0000 Received: by mx03.bss-wf.de (Postfix, from userid 1000) id D31013DD76; Mon, 15 Feb 2021 09:15:39 +0100 (CET) Received: from 9nb.pala (p5b3bcb58.dip0.t-ipconnect.de [91.59.203.88]) by mx03.bss-wf.de (Postfix) with ESMTPSA id DE6703DD74 for <9front@9front.org>; Mon, 15 Feb 2021 09:15:38 +0100 (CET) Message-ID: <3722F8754191D3F8DE6B80755E5B34F4@bss-wf.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit To: 9front@9front.org Date: Mon, 15 Feb 2021 09:15:36 +0100 From: theinicke@bss-wf.de In-Reply-To: <4ADB69E3C2CE209A9CD6A09D402009FE@musolino.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: extended core SSL high-performance-based factory Subject: Re: [9front] Mail rewrite; open path with stored mails Reply-To: 9front@9front.org Precedence: bulk Quoth Alex Musolino : > > + if(atexit(removeopened) == 0) { > > + removeopened(); > > + sysfatal("atexit: %r"); > > + } > > This is not how atexit(2) works. The idea is that you would do > atexit(removeopened) *once* in main which arranges for removeopened to > be called on the way out of the program. The following should > suffice: > > if(atexit(removeopened) == 0) > sysfatal("atexit: %r"); > atexit is only called once, because openmbox is only called once; will move it into main right after openmbox to avoid potential future duplicate calls however, thanks. I decided to call removeopened() if atexit fails, because if we exit the program anyway then we may remove the mbox then and there?