[man-pages] - document why to use shutdown() before close() when dealing with sockets on close(2) man page (#650

pschiffe pschiffe at fedoraproject.org
Wed Sep 19 13:58:02 UTC 2012


commit 55839c4a077f5c29daf6603e8e0d7c58ac5ee0ac
Author: Peter Schiffer <pschiffe at redhat.com>
Date:   Thu Sep 13 19:24:05 2012 +0200

    - document why to use shutdown() before close() when dealing with sockets on close(2) man page (#650985)

 man-pages-3.42-close.patch |   17 +++++++++++++++++
 man-pages.spec             |    4 ++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/man-pages-3.42-close.patch b/man-pages-3.42-close.patch
new file mode 100644
index 0000000..aea1b8a
--- /dev/null
+++ b/man-pages-3.42-close.patch
@@ -0,0 +1,17 @@
+diff -ur man-pages-3.42.orig/man2/close.2 man-pages-3.42/man2/close.2
+--- man-pages-3.42.orig/man2/close.2	2012-08-14 00:39:35.000000000 +0200
++++ man-pages-3.42/man2/close.2	2012-09-13 19:16:38.136978496 +0200
+@@ -114,6 +114,13 @@
+ Since a file descriptor may be reused,
+ there are some obscure race conditions
+ that may cause unintended side effects.
++.PP
++When dealing with sockets, you have to be sure that there is no
++.BR recv (2)
++still blocking on it on another thread, otherwise it might block forever,
++since no more messages will be send via the socket. Be sure to use
++.BR shutdown (2)
++to shut down all parts the connection before closing the socket.
+ .\" Date: Tue, 4 Sep 2007 13:57:35 +0200
+ .\" From: Fredrik Noring <noring at nocrew.org>
+ .\" One such race involves signals and ERESTARTSYS. If a file descriptor
diff --git a/man-pages.spec b/man-pages.spec
index cfe4ec1..5bed7dc 100644
--- a/man-pages.spec
+++ b/man-pages.spec
@@ -57,6 +57,8 @@ Patch51: man-pages-3.42-ip.patch
 Patch52: man-pages-3.42-ip-local-port.patch
 # resolves: #809490
 Patch53: man-pages-3.42-getdents.patch
+# resolves: #650985
+Patch54: man-pages-3.42-close.patch
 
 
 Autoreq: false
@@ -92,6 +94,7 @@ Documentation Project (LDP).
 %patch51 -p1
 %patch52 -p1
 %patch53 -p1
+%patch54 -p1
 
 ## Remove man pages we are not going to use ##
 
@@ -170,6 +173,7 @@ cd ..
 - improved explanation about calling listen or connect on the ip(7) man page (#787567)
 - added information about incorrect use of getdents(2) call to the man page (#809490)
 - removed man-pages-3.22-sched_setaffinity.patch because the problem it describes was fixed in the kernel. see #533811 for more info
+- document why to use shutdown() before close() when dealing with sockets on close(2) man page (#650985)
 
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.41-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild


More information about the scm-commits mailing list