From 660ba28d97c01b8136aee90e9c75da4c3b1ad482 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sun, 31 Aug 2008 09:19:31 -0700 Subject: 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. --- lib/initd-list.c | 7 ------- 1 file changed, 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 #include #include -#ifndef _DIRENT_HAVE_D_TYPE #include #include -#endif #include #include #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) { -- cgit v1.2.3