[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/5] Add systemd socket launching support.
From: |
Matthew Leach |
Subject: |
Re: [PATCH 0/5] Add systemd socket launching support. |
Date: |
Sun, 27 Mar 2016 19:10:23 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Hi Philipp,
Philipp Stephani <address@hidden> writes:
> Matthew Leach <address@hidden> 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
Thanks for the pointer - I didn't know about those functions :-).
--
Matt
Re: [PATCH 0/5] Add systemd socket launching support., Eli Zaretskii, 2016/03/27