Re-revert "Auto-adjust fecdec output buffer size."
[paraslash.git] / net.c
diff --git a/net.c b/net.c
index 2a3fc72be0ad446fa101dcbd9459107fb49f50dd..9579b7df73f6a2b795cc41de9f647a71ee754ec1 100644 (file)
--- a/net.c
+++ b/net.c
@@ -6,6 +6,12 @@
 
 /** \file net.c Networking-related helper functions. */
 
+/*
+ * Since glibc 2.8, the _GNU_SOURCE feature test macro must be defined in order
+ * to obtain the definition of the ucred structure.
+ */
+#define _GNU_SOURCE
+
 #include <netdb.h>
 
 /* At least NetBSD needs these. */
@@ -736,7 +742,7 @@ int recv_cred_buffer(int fd, char *buf, size_t size)
  */
 ssize_t send_cred_buffer(int sock, char *buf)
 {
-       char control[sizeof(struct cmsghdr) + 10];
+       char control[sizeof(struct cmsghdr) + sizeof(struct ucred)];
        struct msghdr msg;
        struct cmsghdr *cmsg;
        static struct iovec iov;