summaryrefslogtreecommitdiff
path: root/usr/src/cmd/rcm_daemon/common/rcm_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/rcm_daemon/common/rcm_subr.c')
-rw-r--r--usr/src/cmd/rcm_daemon/common/rcm_subr.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/usr/src/cmd/rcm_daemon/common/rcm_subr.c b/usr/src/cmd/rcm_daemon/common/rcm_subr.c
index 58281c1297..c6e6c52afa 100644
--- a/usr/src/cmd/rcm_daemon/common/rcm_subr.c
+++ b/usr/src/cmd/rcm_daemon/common/rcm_subr.c
@@ -1504,15 +1504,11 @@ rcmd_db_init()
{
char *tmp;
DIR *mod_dir;
- struct dirent *retp, *entp;
+ struct dirent *entp;
int i;
char *dir_name;
int rcm_script;
-#ifdef lint
-extern int readdir_r(DIR *, struct dirent *, struct dirent **);
-#endif
-
rcm_log_message(RCM_DEBUG, "rcmd_db_init(): initialize database\n");
if (script_main_init() == -1)
@@ -1520,8 +1516,6 @@ extern int readdir_r(DIR *, struct dirent *, struct dirent **);
rsrc_root = rn_alloc("/", RSRC_TYPE_NORMAL);
- entp = s_malloc(PATH_MAX + 1 + sizeof (struct dirent));
-
for (i = 0; (dir_name = rcm_dir(i, &rcm_script)) != NULL; i++) {
if ((mod_dir = opendir(dir_name)) == NULL) {
@@ -1530,13 +1524,9 @@ extern int readdir_r(DIR *, struct dirent *, struct dirent **);
rcm_log_message(RCM_TRACE2, "search directory %s\n", dir_name);
- while (readdir_r(mod_dir, entp, &retp) == 0) {
+ while ((entp = readdir(mod_dir)) != NULL) {
module_t *module;
- if (retp == NULL) {
- break;
- }
-
if (strcmp(entp->d_name, ".") == 0 ||
strcmp(entp->d_name, "..") == 0)
continue;
@@ -1570,7 +1560,6 @@ extern int readdir_r(DIR *, struct dirent *, struct dirent **);
(void) closedir(mod_dir);
}
- free(entp);
rcmd_db_print();
}