aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2016-04-22 15:38:49 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2016-04-22 15:38:49 +0200
commit38f55864aa4b81d2fc1e3c09bdf6f4bd3864be0d (patch)
tree4387e6f04121cf1bd013c02f302cefdd947c69f5
parent6cd7a2c6dac333e33aa49c280359da9805f7141d (diff)
downloadman-pages-master.tar.gz
cmsg.3: Minor cosmetic changes in example codeHEADmaster
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man3/cmsg.36
1 files changed, 3 insertions, 3 deletions
diff --git a/man3/cmsg.3 b/man3/cmsg.3
index 45571ca260..69af571c67 100644
--- a/man3/cmsg.3
+++ b/man3/cmsg.3
@@ -196,18 +196,18 @@ UNIX domain socket using
.PP
.in +4n
.nf
-struct msghdr msg = {0};
+struct msghdr msg = { 0 };
struct cmsghdr *cmsg;
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;