cmsg.3: Minor cosmetic changes in example code

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-04-22 15:38:49 +02:00
parent 6cd7a2c6da
commit 38f55864aa
1 changed files with 3 additions and 3 deletions

View File

@ -202,12 +202,12 @@ int myfds[NUM_FD]; /* Contains the file descriptors to pass */
int *fdptr;
union { /* Ancillary data buffer, wrapped in a union
in order to ensure it is suitably aligned */
char buf[CMSG_SPACE(sizeof myfds)];
char buf[CMSG_SPACE(sizeof(myfds))];
struct cmsghdr align;
} u;
msg.msg_control = u.buf;
msg.msg_controllen = sizeof u.buf;
msg.msg_controllen = sizeof(u.buf);
cmsg = CMSG_FIRSTHDR(&msg);
cmsg\->cmsg_level = SOL_SOCKET;
cmsg\->cmsg_type = SCM_RIGHTS;