X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=9579b7df73f6a2b795cc41de9f647a71ee754ec1;hp=2a3fc72be0ad446fa101dcbd9459107fb49f50dd;hb=1583369f6defebc7f44249b9ce4cc01f717db3b9;hpb=7565af270650435630bf212592286a8c6555d749 diff --git a/net.c b/net.c index 2a3fc72b..9579b7df 100644 --- 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 /* 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;