CMSG_DATA.3: Fix formatting of printf escape sequences

Escape sequences like "\n" have to be escaped twice in examples in our
mdoc(7)-based manual pages in order to be displayed properly. The problem
is that otherwise they are interpreted by mdoc(7), which results in:

    printf("parent: received '%s'0, buf);

being shown to the user instead of:

    printf("parent: received '%s'\n", buf);

Approved by:	bcr (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24056
This commit is contained in:
Mateusz Piotrowski 2020-03-13 11:07:48 +00:00
parent 8cf2c8ed64
commit d7ef92ffae

View File

@ -2,7 +2,7 @@
.\" Public domain, July 3, 2005
.\"
.\" $FreeBSD$
.Dd November 1, 2018
.Dd March 13, 2020
.Dt CMSG_DATA 3
.Os
.Sh NAME
@ -142,7 +142,7 @@ main()
cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SCM_RIGHTS) {
hellofd[1] = *(int *)CMSG_DATA(cmsg);
printf("child: sending '%s'\n", buf);
printf("child: sending '%s'\\n", buf);
if (write(hellofd[1], buf, HELLOLEN) == -1)
err(EX_IOERR, "failed to send 'hello'");
}
@ -166,7 +166,7 @@ main()
if (read(hellofd[0], buf, HELLOLEN) == -1)
err(EX_IOERR, "faild to receive 'hello'");
printf("parent: received '%s'\n", buf);
printf("parent: received '%s'\\n", buf);
break;
}