aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-07-01 20:57:39 -0400
committerRob Austein <sra@hactrn.net>2016-07-01 20:57:39 -0400
commit93d6f4ace94c1198e7befdea370df594af211a83 (patch)
tree555af1e049b5f739cf88914aca3e5282f57b5bc6
parent7bae0000584e4b704c75cfdf7e97a80db412e08e (diff)
glibc "feature test" insanity bites again.
-rw-r--r--daemon.c10
1 files changed, 10 insertions, 0 deletions
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