email plugin: "Calculate" UNIX_PATH_MAX if it is not defined.
authorSebastian Harl <sh@tokkee.org>
Mon, 4 Dec 2006 22:26:18 +0000 (23:26 +0100)
committerFlorian Forster <octo@crystal.wlan.home.verplant.org>
Tue, 5 Dec 2006 09:42:11 +0000 (10:42 +0100)
Some systems (e.g. Darwin) do not seem to define UNIX_PATH_MAX at all. Thus I
calculate it from the size of the sun_path character array of struct
sockaddr_un in this case.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
src/email.c

index b5d8acf..404a20a 100644 (file)
 #      include <sys/un.h>
 #endif /* HAVE_LINUX_UN_H | HAVE_SYS_UN_H */
 
+/* some systems (e.g. Darwin) seem to not define UNIX_PATH_MAX at all */
+#ifndef UNIX_PATH_MAX
+# define UNIX_PATH_MAX sizeof (((struct sockaddr_un *)0)->sun_path)
+#endif /* UNIX_PATH_MAX */
+
 #if HAVE_GRP_H
 #      include <grp.h>
 #endif /* HAVE_GRP_H */