GNU bug report logs -
#54986
[PATCH] gnu: mpd: Add support for socket activation.
Previous Next
Full log
View this message in rfc822 format
Am Samstag, dem 23.04.2022 um 19:31 +0200 schrieb Maxime Devos:
> > +(define (shepherd-endpoint->sexp endpoint)
> > + (match endpoint
> > + (($ <shepherd-endpoint> address
> > + name style backlog socket-owner
> > socket-
> group
> > + socket-directory-permissions)
> > + `(endpoint
> > + ,(match (sockaddr:fam address)
> > + ((? (cute = <> AF_INET) _)
> > + `(make-socket-addr AF_INET
> > + ,(sockaddr:addr address)
> > + ,(sockaddr:port address)))
>
> Liliana Marie Prikler schreef op za 23-04-2022 om 16:39 [+0200]:
> > + (list #$@(map shepherd-endpoint->sexp
> > + (mpd-configuration-shepherd-
> > endpoints config)))
>
> For hygiene reasons, should 'shepherd-endpoint->sexp' use @?
>
> `((@ (the module) endpoint)
> ,(match [...]
> ((@ [...] make-socket-addr (@ [...] AF_UNIX) ...)
> ...))
>
> That way, no assumptions are made on what modules are imported and it
> avoids hygiene problems like in
>
> ;; There are two ‘endpoints’ here: the ‘API endpoint’,
> ;; and Shepherd endpoints.
> #~(let ((endpoint "http://localhost:1234/api"))
> (make-systemd-constructor
> (list #$(file-append soft "/bin/ware")
> "--endpoint" #$endpoint)
> (list (shepherd-endpoint->sexp ...))))
Good point, that's should probably done for defensive programming.
Note also that I'm missing half of the documentation still, so it won't
be pushed too soon, though.
This bug report was last modified 2 years and 34 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.