about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-10-30 15:48:33 +0100
committerFlorian Weimer <fweimer@redhat.com>2017-10-30 15:48:33 +0100
commit4484b9e29656980f18bb0fc8cdb6b1bbe5364f21 (patch)
tree3780df60b52f271014d0ccb66456fe7d6e41b5cf /posix
parent68fe16dd327c895c08b9ee443b234c49c13b36e9 (diff)
downloadglibc-4484b9e29656980f18bb0fc8cdb6b1bbe5364f21.tar.gz
glibc-4484b9e29656980f18bb0fc8cdb6b1bbe5364f21.tar.xz
glibc-4484b9e29656980f18bb0fc8cdb6b1bbe5364f21.zip
Assume that _DIRENT_HAVE_D_TYPE is always defined.
References remain in io/fts.c, io/ftw.c, posix/glob.c,
sysdeps/posix/getcwd.c.  These files are (potentially) externally
shared.
Diffstat (limited to 'posix')
-rw-r--r--posix/bug-glob2.c8
-rw-r--r--posix/tst-dir.c10
-rw-r--r--posix/tst-glob_lstat_compat.c2
-rw-r--r--posix/tst-gnuglob-skeleton.c11
4 files changed, 0 insertions, 31 deletions
diff --git a/posix/bug-glob2.c b/posix/bug-glob2.c
index 592d957a75..c9ed76e134 100644
--- a/posix/bug-glob2.c
+++ b/posix/bug-glob2.c
@@ -207,21 +207,13 @@ my_readdir (void *gdir)
 
   dir->d.d_ino = 1;		/* glob should not skip this entry.  */
 
-#ifdef _DIRENT_HAVE_D_TYPE
   dir->d.d_type = filesystem[dir->idx].type;
-#endif
 
   strcpy (dir->d.d_name, filesystem[dir->idx].name);
 
-#ifdef _DIRENT_HAVE_D_TYPE
   PRINTF ("my_readdir ({ level: %d, idx: %ld }) = { d_ino: %ld, d_type: %d, d_name: \"%s\" }\n",
 	  dir->level, (long int) dir->idx, dir->d.d_ino, dir->d.d_type,
 	  dir->d.d_name);
-#else
-  PRINTF ("my_readdir ({ level: %d, idx: %ld }) = { d_ino: %ld, d_name: \"%s\" }\n",
-	  dir->level, (long int) dir->idx, dir->d.d_ino,
-	  dir->d.d_name);
-#endif
 
   ++dir->idx;
 
diff --git a/posix/tst-dir.c b/posix/tst-dir.c
index fee79b32a0..52ff36fb6e 100644
--- a/posix/tst-dir.c
+++ b/posix/tst-dir.c
@@ -149,10 +149,8 @@ main (int argc, char *argv[])
 
   while ((d = readdir64 (dir1)) != NULL)
     {
-#ifdef _DIRENT_HAVE_D_TYPE
       if (d->d_type != DT_UNKNOWN && d->d_type != DT_REG)
 	continue;
-#endif
 
       if (d->d_ino == st2.st_ino)
 	{
@@ -234,10 +232,8 @@ main (int argc, char *argv[])
 
   while ((d = readdir64 (dir2)) != NULL)
     {
-#ifdef _DIRENT_HAVE_D_TYPE
       if (d->d_type != DT_UNKNOWN && d->d_type != DT_DIR)
 	continue;
-#endif
 
       if (d->d_ino == st2.st_ino)
 	{
@@ -327,10 +323,8 @@ main (int argc, char *argv[])
   rewinddir (dir1);
   while (readdir64_r (dir1, &direntbuf.d, &d) == 0 && d != NULL)
     {
-#ifdef _DIRENT_HAVE_D_TYPE
       if (d->d_type != DT_UNKNOWN && d->d_type != DT_DIR)
 	continue;
-#endif
 
       if (d->d_ino == st1.st_ino)
 	{
@@ -457,13 +451,11 @@ main (int argc, char *argv[])
 	  || strcmp (d->d_name, "..") == 0
 	  || strcmp (d->d_name, "another-dir") == 0)
 	{
-#ifdef _DIRENT_HAVE_D_TYPE
 	  if (d->d_type != DT_UNKNOWN && d->d_type != DT_DIR)
 	    {
 	      printf ("d_type for \"%s\" is wrong\n", d->d_name);
 	      result = 1;
 	    }
-#endif
 	  if (stat64 (d->d_name, &st3) < 0)
 	    {
 	      printf ("cannot stat \"%s\" is wrong\n", d->d_name);
@@ -477,13 +469,11 @@ main (int argc, char *argv[])
 	}
       else if (strcmp (d->d_name, "and-a-file") == 0)
 	{
-#ifdef _DIRENT_HAVE_D_TYPE
 	  if (d->d_type != DT_UNKNOWN && d->d_type != DT_REG)
 	    {
 	      printf ("d_type for \"%s\" is wrong\n", d->d_name);
 	      result = 1;
 	    }
-#endif
 	  if (stat64 (d->d_name, &st3) < 0)
 	    {
 	      printf ("cannot stat \"%s\" is wrong\n", d->d_name);
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index ccfda4bb74..6b77909104 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -166,9 +166,7 @@ my_readdir (void *gdir)
 
   dir->d.d_ino = 1;		/* glob should not skip this entry.  */
 
-#ifdef _DIRENT_HAVE_D_TYPE
   dir->d.d_type = filesystem[dir->idx].type;
-#endif
 
   strcpy (dir->d.d_name, filesystem[dir->idx].name);
 
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 9276297c7c..ba6812bf59 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -221,27 +221,16 @@ my_readdir (void *gdir)
 
   dir->d.d_ino = 1;		/* glob should not skip this entry.  */
 
-#ifdef _DIRENT_HAVE_D_TYPE
   dir->d.d_type = filesystem[dir->idx].type;
-#endif
 
   strcpy (dir->d.d_name, filesystem[dir->idx].name);
 
-#ifdef _DIRENT_HAVE_D_TYPE
   if (test_verbose > 0)
     printf ("info: my_readdir ({ level: %d, idx: %ld })"
 	    " = { d_ino: %lld, d_type: %d, d_name: \"%s\" }\n",
 	    dir->level, (long int) dir->idx,
 	    (long long) dir->d.d_ino, dir->d.d_type,
 	    dir->d.d_name);
-#else
-  if (test_verbose > 0)
-    printf ("info: my_readdir ({ level: %d, idx: %ld })"
-	    " = { d_ino: %lld, d_name: \"%s\" }\n",
-	    dir->level, (long int) dir->idx,
-	    (long long) dir->d.d_ino,
-	    dir->d.d_name);
-#endif
 
   ++dir->idx;