diff options
author | Ralph <ra@apathie.net> | 2015-03-19 08:36:27 +0800 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2016-01-08 00:20:12 +0100 |
commit | 9f5ebd9bf3baab867391f2a4803bea0c2b22c2d9 (patch) | |
tree | be039aa3c420e42f498e36b1f4b91c3b75329060 | |
parent | c5dffb868f3f05943f2328243b797b3c93d018c3 (diff) | |
download | lem-9f5ebd9bf3baab867391f2a4803bea0c2b22c2d9.tar.gz lem-9f5ebd9bf3baab867391f2a4803bea0c2b22c2d9.tar.xz lem-9f5ebd9bf3baab867391f2a4803bea0c2b22c2d9.zip |
io: fix Linux include and UNIX_PATH_MAX fallback
This makes it easier to compile against other C libraries
than glibc.
-rw-r--r-- | lem/io/core.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lem/io/core.c b/lem/io/core.c index 9c8dfc2..1ec3843 100644 --- a/lem/io/core.c +++ b/lem/io/core.c @@ -37,14 +37,15 @@ #include <sys/ucred.h> #include <netinet/in.h> extern char **environ; -#ifndef UNIX_PATH_MAX -#define UNIX_PATH_MAX 104 -#endif #else -#include <linux/un.h> +#include <sys/un.h> #include <sys/sendfile.h> #endif +#ifndef UNIX_PATH_MAX +#define UNIX_PATH_MAX (sizeof ((struct sockaddr_un *)0)->sun_path) +#endif + #include <lem-parsers.h> static int |