Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2020 09:57:27 +0000 (UTC)
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r359354 - stable/12/share/man/man3
Message-ID:  <202003270957.02R9vRKF002653@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: 0mp (doc,ports committer)
Date: Fri Mar 27 09:57:27 2020
New Revision: 359354
URL: https://svnweb.freebsd.org/changeset/base/359354

Log:
  MFC 358954:
  
  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)
  Differential Revision:	https://reviews.freebsd.org/D24056

Modified:
  stable/12/share/man/man3/CMSG_DATA.3
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man3/CMSG_DATA.3
==============================================================================
--- stable/12/share/man/man3/CMSG_DATA.3	Fri Mar 27 09:55:53 2020	(r359353)
+++ stable/12/share/man/man3/CMSG_DATA.3	Fri Mar 27 09:57:27 2020	(r359354)
@@ -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;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003270957.02R9vRKF002653>