From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from duke.felloff.net ([216.126.196.34]) by ewsd; Fri Nov 15 20:08:46 EST 2019 Message-ID: <121AFD953318E2873669556F35BF0C7C@felloff.net> Date: Sat, 16 Nov 2019 02:08:36 +0100 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] unofficial sdcard image for raspberry pi 4 testing In-Reply-To: 7084F2A97B3ECD6C74D2C98C7671019C@hera.eonet.ne.jp 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: abstract base pipelining event thats the way the kernel does exception handling. basically, when error() is called, it jumps to the last invocation of waserror(), and returns 1. waserror() sets up the jumplabel. on first invocation, it returns 0, so the print does not happen the first time. but if some error condition happens, and someone calls error() then it jumps right back to waserror(), and waserror returns with 1. poperror() removes the jump label. example: if(waserror()){ print("an error happend\n"); return; } ... if(somevar) error("something went wrong"); ... print("everything went fine\n"); poperror(); will print "an error happend" once error() is called and somevar is non-zero. but it somevar is zero, it prints "everything went fine" this is often used to cleanup in the error case. you'll find code like: x = allocatesomething() if(waserror()){ freesomething(x); nexterror(); } ... dosomethingwith(x); ... poperror(); when dosomethingwithx() calls error(), this will clean up. but in normal case, it will complete fine and once finished, remove the error label pushed by waserror() so the error handling can be nested. hope this explains it. -- cinap