summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2008-08-31 09:19:31 -0700
committerDan Nicholson <dbn.lists@gmail.com>2008-08-31 09:19:31 -0700
commit660ba28d97c01b8136aee90e9c75da4c3b1ad482 (patch)
treed15f80b77a71045fb33cb7712c293c1d5f819b84
parent9a0f403371c7f9215f1a6649fcc3773778c7277f (diff)
Tear out the buggy dirent d_type code for now
Trying to use the d_type field from the dirent structure returns DT_UNKNOWN sometimes causing the pool to never be populated. Remove it for now in favor of the more portable stat() usage.
-rw-r--r--lib/initd-list.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/initd-list.c b/lib/initd-list.c
index dfdecb7..debb0a1 100644
--- a/lib/initd-list.c
+++ b/lib/initd-list.c
@@ -8,10 +8,8 @@
#include <stdbool.h>
#include <sys/types.h>
#include <dirent.h>
-#ifndef _DIRENT_HAVE_D_TYPE
#include <sys/stat.h>
#include <unistd.h>
-#endif
#include <limits.h>
#include <stdio.h>
#include "initd.h"
@@ -114,16 +112,11 @@ initd_list_t *initd_list_from_dir(const char *dir)
if (plen < 0)
error(2, errno, "%s", de->d_name);
-#ifdef _DIRENT_HAVE_D_TYPE
- if ((!de->d_type) || (de->d_type != DT_REG))
- continue;
-#else
struct stat ip_buf;
if (stat(ip_path, &ip_buf) < 0)
error(2, errno, "%s", ip_path);
if (!S_ISREG(ip_buf.st_mode))
continue;
-#endif /* _DIRENT_HAVE_D_TYPE */
ip = initd_parse(ip_path);
if (ip) {