Skip to content

ccan: fix compilation error about const types #6950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ccan/ccan/fdpass/fdpass.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <errno.h>
#include <string.h>

#define BUF_SIZE CMSG_SPACE(sizeof(fd))

bool fdpass_send(int sockout, int fd)
{
/* From the cmsg(3) manpage: */
Expand All @@ -13,7 +15,7 @@ bool fdpass_send(int sockout, int fd)
char c = 0;
union { /* Ancillary data buffer, wrapped in a union
in order to ensure it is suitably aligned */
char buf[CMSG_SPACE(sizeof(fd))];
char buf[BUF_SIZE];
struct cmsghdr align;
} u;

Expand Down Expand Up @@ -50,7 +52,7 @@ int fdpass_recv(int sockin)
char c;
union { /* Ancillary data buffer, wrapped in a union
in order to ensure it is suitably aligned */
char buf[CMSG_SPACE(sizeof(fd))];
char buf[BUF_SIZE];
struct cmsghdr align;
} u;

Expand Down