hyc, (edited ) Gag, puke, retch... This sample code for communicating with #systemd is abominable. https://www.freedesktop.org/software/systemd/man/devel/sd_notify.html
From gratuitous use of superfluous language features (a cleanup handler, for a single fd, srsly?) to inappropriate use of standard POSIX APIs (using connect+write on a socket that only sends one message and then gets closed, really?) Older compilers don't even support a cleanup attribute, and this code is used as a model of portability??
#OpenLDAP's version is better.
Add comment