From 0e2ca7edac7d3bbdb772cea2d42c4daa87474786 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Sat, 14 Jan 2012 14:13:38 -0700 Subject: [PATCH] Remove service.d directory since plugins are gone Signed-off-by: Steven Dake Reviewed-by: Fabio Di Nitto --- corosync.spec.in | 1 - exec/coroparse.c | 64 ------------------------------------------------ 2 files changed, 65 deletions(-) diff --git a/corosync.spec.in b/corosync.spec.in index 58603cab..7f084f18 100644 --- a/corosync.spec.in +++ b/corosync.spec.in @@ -156,7 +156,6 @@ fi %{_bindir}/corosync-xmlproc %endif %dir %{_sysconfdir}/corosync -%dir %{_sysconfdir}/corosync/service.d %dir %{_sysconfdir}/corosync/uidgid.d %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu diff --git a/exec/coroparse.c b/exec/coroparse.c index 187b2a43..1de940a2 100644 --- a/exec/coroparse.c +++ b/exec/coroparse.c @@ -901,66 +901,6 @@ error_exit: return res; } -static int read_service_files_into_icmap( - const char **error_string) -{ - FILE *fp; - const char *dirname; - DIR *dp; - struct dirent *dirent; - struct dirent *entry; - char filename[PATH_MAX + FILENAME_MAX + 1]; - int res = 0; - struct stat stat_buf; - size_t len; - int return_code; - char key_name[ICMAP_KEYNAME_MAXLEN]; - struct main_cp_cb_data data; - - dirname = COROSYSCONFDIR "/service.d"; - dp = opendir (dirname); - - if (dp == NULL) - return 0; - - len = offsetof(struct dirent, d_name) + NAME_MAX + 1; - - entry = malloc(len); - if (entry == NULL) { - res = 0; - goto error_exit; - } - - for (return_code = readdir_r(dp, entry, &dirent); - dirent != NULL && return_code == 0; - return_code = readdir_r(dp, entry, &dirent)) { - - snprintf(filename, sizeof (filename), "%s/%s", dirname, dirent->d_name); - stat (filename, &stat_buf); - if (S_ISREG(stat_buf.st_mode)) { - - fp = fopen (filename, "r"); - if (fp == NULL) continue; - - key_name[0] = 0; - - res = parse_section(fp, key_name, error_string, main_config_parser_cb, &data); - - fclose (fp); - - if (res != 0) { - goto error_exit; - } - } - } - -error_exit: - free (entry); - closedir(dp); - - return res; -} - /* Read config file and load into icmap */ static int read_config_file_into_icmap( const char **error_string) @@ -997,10 +937,6 @@ static int read_config_file_into_icmap( res = read_uidgid_files_into_icmap(error_string); } - if (res == 0) { - res = read_service_files_into_icmap(error_string); - } - if (res == 0) { snprintf (error_reason, sizeof(error_string_response), "Successfully read main configuration file '%s'.\n", filename);