From 93d6f4ace94c1198e7befdea370df594af211a83 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 1 Jul 2016 20:57:39 -0400 Subject: glibc "feature test" insanity bites again. --- daemon.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/daemon.c b/daemon.c index 81851ed..f22ad45 100644 --- a/daemon.c +++ b/daemon.c @@ -49,6 +49,16 @@ static char usage[] = "usage: %s [-n socketname] [-d ttydevice] [-s ttyspeed]\n"; +/* + * Work around glibc "feature test" insanity. This isn't the correct + * definition according to the POSIX, but it does what seems to be the + * normal hack on Linux (where this is broken more often than not). + */ + +#ifndef SUN_LEN +#define SUN_LEN(_sun_ptr_) (sizeof(*(_sun_ptr_))) +#endif + /* select() is hopelessly broken, and epoll() is Linux-specific, so we'll use * poll() until such a time as libevent or libev seems more appropriate. * Unfortunately, poll() doesn't come with any macros or functions to manage -- cgit v1.2.3