From d28fad77486ce53230d4b8b5731e7f06276c2e92 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 8 Jan 2016 02:13:39 +0000 Subject: It was very surprising that a function called mparse_readfd() closed the file descriptor passed to it after completing its work, in particular considering the fact that it required its callers to call open(2) or mparse_open() beforehand. Change mparse_readfd() to not call close(2) and change the callers to call close(2) afterwards, more or less bringing open and close to the same level of the code and making review easier. Note that man.cgi(8) already did that, even though it was wrong in the past. Small restructuring suggested by Christos Zoulas (NetBSD). --- mandoc.3 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mandoc.3') diff --git a/mandoc.3 b/mandoc.3 index 01a72bc6..b52f65f6 100644 --- a/mandoc.3 +++ b/mandoc.3 @@ -177,6 +177,9 @@ or parse it with .Fn mparse_readfd ; .It +close it with +.Xr close 2 ; +.It retrieve the syntax tree with .Fn mparse_result ; .It @@ -403,6 +406,8 @@ or Pass the associated filename in .Va fname . This function may be called multiple times with different parameters; however, +.Xr close 2 +and .Fn mparse_reset should be invoked between parses. Declared in -- cgit