This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.23-31-g7584a3f


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  7584a3f96de88d5eefe5d6c634515278cbfbf052 (commit)
      from  8d9c92017d85f23ba6a2b3614b2f2bcf1820d6f0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7584a3f96de88d5eefe5d6c634515278cbfbf052

commit 7584a3f96de88d5eefe5d6c634515278cbfbf052
Author: Florian Weimer <fweimer@redhat.com>
Date:   Sat Feb 20 12:56:55 2016 +0100

    Deprecate readdir_r, readdir64_r [BZ #19056]

diff --git a/ChangeLog b/ChangeLog
index db05bdc..c1efd1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-02-20  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #19056]
+	* dirent/dirent.h (readdir_r, readdir64_r): Mark as deprecated.
+	* manual/filesys.texi (Reading/Closing Directory): Mention
+	deprecaion.
+	* posix/tst-dir.c (main): Disable deprecation warning in test.
+
 2016-02-19  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #19679]
diff --git a/NEWS b/NEWS
index d6f9d74..dc5a382 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,9 @@ Version 2.24
   time.  It has been replaced by pap_AW & pap_CW, both of which have long
   been included in previous releases.
 
+* The readdir_r and readdir64_r functions have been deprecated.  It is
+  recommended to use readdir and readdir64 instead.
+
 Security related changes:
 
   [Add security related changes here]
diff --git a/dirent/dirent.h b/dirent/dirent.h
index 9a4b6bf..e6c36b1 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
@@ -183,14 +183,15 @@ extern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1));
 extern int readdir_r (DIR *__restrict __dirp,
 		      struct dirent *__restrict __entry,
 		      struct dirent **__restrict __result)
-     __nonnull ((1, 2, 3));
+     __nonnull ((1, 2, 3)) __attribute_deprecated__;
 # else
 #  ifdef __REDIRECT
 extern int __REDIRECT (readdir_r,
 		       (DIR *__restrict __dirp,
 			struct dirent *__restrict __entry,
 			struct dirent **__restrict __result),
-		       readdir64_r) __nonnull ((1, 2, 3));
+		       readdir64_r)
+  __nonnull ((1, 2, 3)) __attribute_deprecated__;
 #  else
 #   define readdir_r readdir64_r
 #  endif
@@ -200,7 +201,7 @@ extern int __REDIRECT (readdir_r,
 extern int readdir64_r (DIR *__restrict __dirp,
 			struct dirent64 *__restrict __entry,
 			struct dirent64 **__restrict __result)
-     __nonnull ((1, 2, 3));
+  __nonnull ((1, 2, 3)) __attribute_deprecated__;
 # endif
 #endif	/* POSIX or misc */
 
diff --git a/manual/filesys.texi b/manual/filesys.texi
index 972e106..b323664 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -525,8 +525,9 @@ locking.  Like @code{readdir} it returns the next entry from the
 directory.  To prevent conflicts between simultaneously running
 threads the result is stored inside the @var{entry} object.
 
-@strong{Portability Note:} It is recommended to use @code{readdir}
-instead of @code{readdir_r} for the following reasons:
+@strong{Portability Note:} @code{readdir_r} is deprecated.  It is
+recommended to use @code{readdir} instead of @code{readdir_r} for the
+following reasons:
 
 @itemize @bullet
 @item
@@ -604,10 +605,10 @@ In all other aspects this function is equivalent to @code{readdir}.
 @comment LFS
 @deftypefun int readdir64_r (DIR *@var{dirstream}, struct dirent64 *@var{entry}, struct dirent64 **@var{result})
 @safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
-The @code{readdir64_r} function is equivalent to the @code{readdir_r}
-function except that it takes parameters of base type @code{struct
-dirent64} instead of @code{struct dirent} in the second and third
-position.  The same precautions mentioned in the documentation of
+The deprecated @code{readdir64_r} function is equivalent to the
+@code{readdir_r} function except that it takes parameters of base type
+@code{struct dirent64} instead of @code{struct dirent} in the second and
+third position.  The same precautions mentioned in the documentation of
 @code{readdir_r} also apply here.
 @end deftypefun
 
diff --git a/posix/tst-dir.c b/posix/tst-dir.c
index 8897f8e..d0e4878 100644
--- a/posix/tst-dir.c
+++ b/posix/tst-dir.c
@@ -319,6 +319,10 @@ main (int argc, char *argv[])
       exit (1);
     }
 
+  /* The test below covers the deprecated readdir64_r function.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
+
   /* Try to find the new directory.  */
   rewinddir (dir1);
   while (readdir64_r (dir1, &direntbuf.d, &d) == 0 && d != NULL)
@@ -351,6 +355,8 @@ main (int argc, char *argv[])
 	}
     }
 
+  DIAG_POP_NEEDS_COMMENT;
+
   if (d == NULL)
     {
       printf ("haven't found new directory \"%s\"\n", buf);
@@ -439,6 +445,10 @@ main (int argc, char *argv[])
       result = 1;
     }
 
+  /* The test below covers the deprecated readdir64_r function.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
+
   /* We now should have a directory and a file in the new directory.  */
   rewinddir (dir2);
   while (readdir64_r (dir2, &direntbuf.d, &d) == 0 && d != NULL)
@@ -492,6 +502,8 @@ main (int argc, char *argv[])
 	}
     }
 
+  DIAG_POP_NEEDS_COMMENT;
+
   if (stat64 ("does-not-exist", &st1) >= 0)
     {
       puts ("stat for unexisting file did not fail");

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    8 ++++++++
 NEWS                |    3 +++
 dirent/dirent.h     |    7 ++++---
 manual/filesys.texi |   13 +++++++------
 posix/tst-dir.c     |   12 ++++++++++++
 5 files changed, 34 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]