<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/fdm.c, branch 1.8.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.8.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.8.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-05-21T18:00:45Z</updated>
<entry>
<title>fdm: always check for signals after epoll_pwait(), not only on EINTR</title>
<updated>2021-05-21T18:00:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-21T18:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=890dbc49cf440cb765a4d758abab6e39dc9b2e73'/>
<id>urn:sha1:890dbc49cf440cb765a4d758abab6e39dc9b2e73</id>
<content type='text'>
This fixes an issue where we, at least on FreeBSD, sometimes get stuck
in epoll_pwait() after the shell has exited.

It turned out to be because the SIGCHLD signal was delivered at the
same time FDs were made readable/writeable. I.e. epoll_pwait()
returned a non-zero value even though it should have been interrupted
by the SIGCHLD.

To avoid having to search the entire signal array *every time*
epoll_pwait() returns, add a flag that is set in the signal
handler. This tells the FDM to scan the signal array after returning
from epoll_pwait().
</content>
</entry>
<entry>
<title>spawn/slave: restore signal mask after fork</title>
<updated>2021-02-21T18:59:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-21T10:57:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dd5c31657ee934c52f24fd77778c56468d668b45'/>
<id>urn:sha1:dd5c31657ee934c52f24fd77778c56468d668b45</id>
<content type='text'>
slave: no need to restore signal handlers; they are automatically
restored as long as they are not SIG_IGN (which they never are in
foot).

spawn(): restore signal mask after fork. This fixes an issue where a
terminal spawned with ctrl+shift+n did not terminate when its shell
exited.

Closes #366
</content>
</entry>
<entry>
<title>fdm: add support for managing signals</title>
<updated>2021-02-11T17:55:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-10T15:17:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=863ae1143f9336f300c300c4d62165c3eac22834'/>
<id>urn:sha1:863ae1143f9336f300c300c4d62165c3eac22834</id>
<content type='text'>
Add fdm_signal_add() and fdm_signal_del(). Signals added to the fdm
will be monitored, and the provided callback called as “soon as
possible” from the main context (i.e not from the signal handler
context).

Monitored signals are *blocked* by default. We use epoll_pwait() to
unblock them while we’re polling. This allows us to do race-free
signal detection.

We use a single handler for all monitored signals; the handler simply
updates the signal’s slot in a global array (sized to fit SIGRTMAX
signals).

When epoll_pwait() returns EINTR, we loop the global array. The
callback associated with each signal that fired is called.
</content>
</entry>
<entry>
<title>Convert all but 2 remaining uses of xassert(false) to BUG("...")</title>
<updated>2021-02-10T09:01:51Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-02-10T09:01:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3c86af52c2a3e9352a88e969392575e55c3b6f74'/>
<id>urn:sha1:3c86af52c2a3e9352a88e969392575e55c3b6f74</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert some uses of xassert(false) to BUG("some error message")</title>
<updated>2021-02-09T13:52:33Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-02-09T13:52:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ec56844387ed910b7e87bae186b58cc22cc317a'/>
<id>urn:sha1:1ec56844387ed910b7e87bae186b58cc22cc317a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>debug: rename assert() to xassert(), to avoid clashing with &lt;assert.h&gt;</title>
<updated>2021-01-16T20:16:00Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-16T20:16:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e56136ce1192d04a52b01ccb41284f0b7896430e'/>
<id>urn:sha1:e56136ce1192d04a52b01ccb41284f0b7896430e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Print stack trace on assert() failure or when calling fatal_error()</title>
<updated>2021-01-16T19:56:33Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-15T20:39:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9'/>
<id>urn:sha1:22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9</id>
<content type='text'>
Note: this uses the __sanitizer_print_stack_trace() function from the
AddressSanitizer runtime, so it only works when AddressSanitizer is
in use.
</content>
</entry>
<entry>
<title>fdm: do *not* keep polling on EINTR</title>
<updated>2020-12-04T17:36:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-04T17:36:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=384ba4d30d4a77751a8068d9aebaaee2c02cf10c'/>
<id>urn:sha1:384ba4d30d4a77751a8068d9aebaaee2c02cf10c</id>
<content type='text'>
This fixes an issue where foot --server did not exit on SIGINT. This
happened because we never returned out from fdm_poll(), and thus we
never saw ‘aborted’ being set.
</content>
</entry>
<entry>
<title>fdm: keep polling on EINTR</title>
<updated>2020-11-26T17:23:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-26T17:23:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=15b35b7641955949acaa209986ff3fa8b7f1a98e'/>
<id>urn:sha1:15b35b7641955949acaa209986ff3fa8b7f1a98e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Cast printf formatter %p arguments to void*</title>
<updated>2020-08-23T08:07:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-23T05:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e32c0d9bf698782353bbe9e4348617523af473bd'/>
<id>urn:sha1:e32c0d9bf698782353bbe9e4348617523af473bd</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>fdm: fix log message</title>
<updated>2020-01-10T18:22:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-10T18:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a07de9ef3c402371b5a484b6eb2271ec31a774b9'/>
<id>urn:sha1:a07de9ef3c402371b5a484b6eb2271ec31a774b9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fdm: verify FDs are non-blocking (debug builds only)</title>
<updated>2020-01-10T18:22:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-10T18:22:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=698d5fdf06b79b66633629c7a387fa26ff352eca'/>
<id>urn:sha1:698d5fdf06b79b66633629c7a387fa26ff352eca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fdm: add hook priorities</title>
<updated>2020-01-04T22:26:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T22:26:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6534f64e6a1dfa21d8d99a195122035d741f7d65'/>
<id>urn:sha1:6534f64e6a1dfa21d8d99a195122035d741f7d65</id>
<content type='text'>
There are now three hook priorities: low, normal, high.

High priority hooks are executed *first*. Normal next, and last the
low priority hooks.

The renderer's terminal refresh hook now runs as a normal priority
hook.
</content>
</entry>
<entry>
<title>fdm: add support for hooks</title>
<updated>2020-01-04T18:48:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T18:48:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a3c18e72f5804051c5111fea5f4fca488fa088ca'/>
<id>urn:sha1:a3c18e72f5804051c5111fea5f4fca488fa088ca</id>
<content type='text'>
Hooks are functions executed just before going into a poll(). Or just
after executing all FD handlers, if you like.
</content>
</entry>
<entry>
<title>fdm: close fd even if we didn't find it in our list</title>
<updated>2019-12-15T14:06:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-15T14:06:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5106937c7b24933bb1f906f672606147c4bac1cb'/>
<id>urn:sha1:5106937c7b24933bb1f906f672606147c4bac1cb</id>
<content type='text'>
This behavior is debatable, but helps in error handling where we're
removing a bunch of descriptors where not all of them have been added
to the FDM yet.
</content>
</entry>
<entry>
<title>tllist: is now an external "library", so use &lt;&gt; includes</title>
<updated>2019-11-17T18:19:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-17T18:19:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=29cccadd1d9c372b3861bb0c285628bb374da2ba'/>
<id>urn:sha1:29cccadd1d9c372b3861bb0c285628bb374da2ba</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fdm: invert check to get rid of one level of indentation</title>
<updated>2019-11-02T23:52:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-02T23:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=777d851282a59fcfacc19b9232b9ad80c412efdf'/>
<id>urn:sha1:777d851282a59fcfacc19b9232b9ad80c412efdf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fdm: add fdm_event_add() and fdm_event_del()</title>
<updated>2019-11-02T23:52:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-02T23:22:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=89997b97a0fb7f0fe0fa06de5409a03ed9ee91a8'/>
<id>urn:sha1:89997b97a0fb7f0fe0fa06de5409a03ed9ee91a8</id>
<content type='text'>
These functions allow users to modify already registered FDs, to add
or remove events they are interested in.
</content>
</entry>
<entry>
<title>fdm: bug: 'ret' was renamed to 'r', and replaced with another 'ret'</title>
<updated>2019-11-02T23:51:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-02T23:51:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e09bda322a2d39e6692b3dbd3ccf72bc86951737'/>
<id>urn:sha1:e09bda322a2d39e6692b3dbd3ccf72bc86951737</id>
<content type='text'>
</content>
</entry>
</feed>
