<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/reaper.c, branch 1.17.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.17.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.17.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-02-12T09:53:10Z</updated>
<entry>
<title>reaper: monitor SIGCHLD using the FDM instead of via a signalfd</title>
<updated>2021-02-12T09:53:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-10T15:22:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=79e3a4694365b58b482f2f437052773711ec67dc'/>
<id>urn:sha1:79e3a4694365b58b482f2f437052773711ec67dc</id>
<content type='text'>
In addition to letting the FDM do the low-level signal watching, this
patch also fixes a bug; multiple SIGCHLDs, be it delivered either through a
signal, or via a signalfd, can be coalesced, like all signals.

This means we need to loop on waitpid() with WNOHANG until there are
no more processes to reap.

This in turn requires a small change to the way reaper callbacks are
implemented.

Previously, the callback was allowed to do the wait(). This was
signalled back to the reaper through the callback’s return value.

Now, since we’ve already wait():ed, the process’ exit status is passed
as an argument to the reaper callback.

The callback for the client application has been updated accordingly;
it sets a flag in the terminal struct, telling term_destroy() that the
process has already been wait():ed on, and also stores the exit
status.
</content>
</entry>
<entry>
<title>reaper: remove child from list *before* calling the user provided callback</title>
<updated>2021-01-21T10:55:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-12T08:30:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=324a1f80a8a90cb4d087c8056241cf5649dde5ce'/>
<id>urn:sha1:324a1f80a8a90cb4d087c8056241cf5649dde5ce</id>
<content type='text'>
The user provided callback may call reaper_del(), in which case we
will crash when we also try to remove the child from the list.

Remove it from the list before the callback means reaper_del() (if
called by the callback) will just loop through the entire list without
finding the pid and thus do nothing.
</content>
</entry>
<entry>
<title>reaper: add reaper_del() - pid is no longer watched/monitored after this</title>
<updated>2021-01-21T10:55:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-12T08:20:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a698fa62e28468ec52b2408cdc293803a3965dfe'/>
<id>urn:sha1:a698fa62e28468ec52b2408cdc293803a3965dfe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>reaper: add optional callback</title>
<updated>2021-01-21T10:43:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-26T00:26:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c28bba7a55866abcdab38422026dced7d6d4940d'/>
<id>urn:sha1:c28bba7a55866abcdab38422026dced7d6d4940d</id>
<content type='text'>
When calling ‘reaper_add()’, the caller can provide a callback. If
non-NULL, the reaper will call the callback to handle the actual
reaping.

If the callback is NULL, or if it returns false, the reaper reaps the
child process.
</content>
</entry>
<entry>
<title>Fix some spelling mistakes</title>
<updated>2020-08-15T18:39:00Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-15T18:39:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=104fe2fa55b113212899bea893a13fe7b3467156'/>
<id>urn:sha1:104fe2fa55b113212899bea893a13fe7b3467156</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Handle allocation failures explicitly in *_init() functions</title>
<updated>2020-08-09T07:55:20Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-09T07:55:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4e6100494c4fdea43cb95df1abb68958a89d7935'/>
<id>urn:sha1:4e6100494c4fdea43cb95df1abb68958a89d7935</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert most dynamic allocations to use functions from xmalloc.h</title>
<updated>2020-08-08T19:37:57Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-08T19:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a77958ba20c2b344be5e66e69e2f212a4bbf6b3'/>
<id>urn:sha1:7a77958ba20c2b344be5e66e69e2f212a4bbf6b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>reaper: disable debug logging</title>
<updated>2020-05-21T18:27:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-21T18:27:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=89dd31bfd7210b8b0fb747a4b9a7e1d73b306a4a'/>
<id>urn:sha1:89dd31bfd7210b8b0fb747a4b9a7e1d73b306a4a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>reaper: new module, uses a signalfd to wait() on child processes</title>
<updated>2020-05-21T18:15:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-21T18:15:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f49742ebba769e5024f178428d6e7ad048f18e77'/>
<id>urn:sha1:f49742ebba769e5024f178428d6e7ad048f18e77</id>
<content type='text'>
Use a signalfd to listen for SIGCHLD signals.

When we receive a SIGCHLD over the signalfd, reap all dead children by
looping over all registered child PIDs and call waitpid(WNOHANG) on
them.
</content>
</entry>
</feed>
