<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cimple/src/string.h, branch meson</title>
<subtitle>My little CI system (hopefully)</subtitle>
<id>http://git.tensin.name/cimple/atom?h=meson</id>
<link rel='self' href='http://git.tensin.name/cimple/atom?h=meson'/>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/'/>
<updated>2026-09-21T17:19:05Z</updated>
<entry>
<title>remove annoying trailing period from repo URLs</title>
<updated>2026-09-21T17:19:05Z</updated>
<author>
<name>Egor Tensin</name>
<email>egor@tensin.name</email>
</author>
<published>2026-09-21T17:19:05Z</published>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/commit/?id=588fd2262c2f65e237a5a4e4858e06b4b87aaae3'/>
<id>urn:sha1:588fd2262c2f65e237a5a4e4858e06b4b87aaae3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unify my .clang-format files</title>
<updated>2026-06-12T15:20:08Z</updated>
<author>
<name>Egor Tensin</name>
<email>egor@tensin.name</email>
</author>
<published>2026-06-12T15:20:08Z</published>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/commit/?id=1160cdb21e0b667269299853cb47a4aa88948dc3'/>
<id>urn:sha1:1160cdb21e0b667269299853cb47a4aa88948dc3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>string: stpecpy -&gt; string_append</title>
<updated>2023-12-30T22:22:59Z</updated>
<author>
<name>Egor Tensin</name>
<email>egor@tensin.name</email>
</author>
<published>2023-12-30T22:22:59Z</published>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/commit/?id=3d878bfc3ed733ca3b29ecc2ff50a96dfb47ca06'/>
<id>urn:sha1:3d878bfc3ed733ca3b29ecc2ff50a96dfb47ca06</id>
<content type='text'>
</content>
</entry>
<entry>
<title>switch to egor@tensin.name</title>
<updated>2023-12-12T20:29:42Z</updated>
<author>
<name>Egor Tensin</name>
<email>egor@tensin.name</email>
</author>
<published>2023-12-12T20:29:42Z</published>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/commit/?id=82c5f204346def706fdc7ee28a8e2570fb880369'/>
<id>urn:sha1:82c5f204346def706fdc7ee28a8e2570fb880369</id>
<content type='text'>
</content>
</entry>
<entry>
<title>string: add a comment</title>
<updated>2023-07-09T23:38:32Z</updated>
<author>
<name>Egor Tensin</name>
<email>Egor.Tensin@gmail.com</email>
</author>
<published>2023-07-09T23:38:32Z</published>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/commit/?id=c1b01c48e457ca287631fb27ad4c553d0246d5a6'/>
<id>urn:sha1:c1b01c48e457ca287631fb27ad4c553d0246d5a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>storage: mark completed runs as such</title>
<updated>2023-07-04T18:51:29Z</updated>
<author>
<name>Egor Tensin</name>
<email>Egor.Tensin@gmail.com</email>
</author>
<published>2023-07-04T18:51:29Z</published>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/commit/?id=d4e47fdb640c3ddce285157eee88db899461fa3a'/>
<id>urn:sha1:d4e47fdb640c3ddce285157eee88db899461fa3a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use signalfd to stop on SIGTERM</title>
<updated>2023-06-12T23:37:08Z</updated>
<author>
<name>Egor Tensin</name>
<email>Egor.Tensin@gmail.com</email>
</author>
<published>2023-06-11T23:42:08Z</published>
<link rel='alternate' type='text/html' href='http://git.tensin.name/cimple/commit/?id=48ce9170b057ddd2165b0239a92aede15849f7a3'/>
<id>urn:sha1:48ce9170b057ddd2165b0239a92aede15849f7a3</id>
<content type='text'>
Is this an overkill? I don't know.

The thing is, correctly intercepting SIGTERM (also SIGINT, etc.) is
incredibly tricky. For example, before this commit, my I/O loops in
server.c and worker.c were inherently racy.

This was immediately obvious if you tried to run the tests. The tests
(especially the Valgrind flavour) would run a worker, wait until it
prints a "Waiting for a new command" line, and try to kill it using
SIGTERM. The problem is, the global_stop_flag check could have already
been executed by the worker, and it would hang forever in recv().

The solution seems to be to use signalfd and select()/poll(). I've never
used either before, but it seems to work well enough - at least the very
same tests pass and don't hang now.
</content>
</entry>
</feed>
