Matthew Leach schrieb am So., 27. März 2016 um 17:17 Uhr: > >> +#ifdef HAVE_SYSTEMD > >> + /* Read the number of sockets passed through by systemd. */ > >> + systemd_socket = sd_listen_fds(0); > > > > Isn't it prudent to test the socket descriptor for validity? What if > > it isn't a socket, for example? > > Agreed. I'm thinking about trying getsockname as a test for validity as > this should also ensure that the socket is already bound. > The systemd library has some helper functions for that: https://www.freedesktop.org/software/systemd/man/sd_is_fifo.html