changeset 17642:8af917141d49

fts: avoid unnecessary strlen calls Not all platforms have _D_EXACT_NAMLEN. * lib/fts.c (_D_EXACT_NAMLEN): Restore definition when needed. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 09 Apr 2014 10:20:08 -0600
parents 019200939aa7
children eaa841a1f670
files ChangeLog lib/fts.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 09 09:08:55 2014 -0700
+++ b/ChangeLog	Wed Apr 09 10:20:08 2014 -0600
@@ -1,3 +1,8 @@
+2014-04-09  Eric Blake  <eblake@redhat.com>
+
+	fts: avoid unnecessary strlen calls
+	* lib/fts.c (_D_EXACT_NAMLEN): Restore definition when needed.
+
 2014-04-09  Paul Eggert  <eggert@cs.ucla.edu>
 
 	fts: avoid unnecessary strlen calls
--- a/lib/fts.c	Wed Apr 09 09:08:55 2014 -0700
+++ b/lib/fts.c	Wed Apr 09 10:20:08 2014 -0600
@@ -79,6 +79,9 @@
 #endif
 
 #include <dirent.h>
+#ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(dirent) strlen ((dirent)->d_name)
+#endif
 
 #if HAVE_STRUCT_DIRENT_D_TYPE
 /* True if the type of the directory entry D is known.  */