[PATCH] getmntent.3: clarify that endmntent should be used rather than fclose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This doesn't actually matter on any C library I know of --- they all
just do a NULL check and forward to fclose(3). (The actual mistake I
saw was someone not realizing that they had to call *anything*.)
---
 man3/getmntent.3 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/man3/getmntent.3 b/man3/getmntent.3
index 8f3f2686a..6ccc26b5f 100644
--- a/man3/getmntent.3
+++ b/man3/getmntent.3
@@ -84,6 +84,10 @@ required and can take the same values as the
 .I mode
 argument of
 .BR fopen (3).
+The returned stream should be closed using
+.BR endmntent ()
+rather than
+.BR fclose (3).
 .PP
 The
 .BR getmntent ()
-- 
2.19.0.605.g01d371f741-goog
From a1a889900919d5e51e0498b9d5d712f0ae3fbab5 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <enh@xxxxxxxxxx>
Date: Wed, 3 Oct 2018 12:57:42 -0700
Subject: [PATCH] getmntent.3: clarify that endmntent should be used rather
 than fclose

This doesn't actually matter on any C library I know of --- they all
just do a NULL check and forward to fclose(3). (The actual mistake I
saw was someone not realizing that they had to call *anything*.)
---
 man3/getmntent.3 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/man3/getmntent.3 b/man3/getmntent.3
index 8f3f2686a..6ccc26b5f 100644
--- a/man3/getmntent.3
+++ b/man3/getmntent.3
@@ -84,6 +84,10 @@ required and can take the same values as the
 .I mode
 argument of
 .BR fopen (3).
+The returned stream should be closed using
+.BR endmntent ()
+rather than
+.BR fclose (3).
 .PP
 The
 .BR getmntent ()
-- 
2.19.0.605.g01d371f741-goog


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux