Bläddra i källkod

rename mainconfig to logconfig

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto 13 år sedan
förälder
incheckning
f008cf442c
7 ändrade filer med 24 tillägg och 25 borttagningar
  1. 3 3
      exec/Makefile.am
  2. 0 1
      exec/ipc_glue.c
  3. 11 11
      exec/logconfig.c
  4. 6 6
      exec/logconfig.h
  5. 3 3
      exec/main.c
  6. 0 1
      exec/service.c
  7. 1 0
      exec/util.h

+ 3 - 3
exec/Makefile.am

@@ -31,7 +31,7 @@
 
 
 MAINTAINERCLEANFILES	= Makefile.in
 MAINTAINERCLEANFILES	= Makefile.in
 
 
-AM_CFLAGS		= -fPIC -DMAINCONFIG_USE_ICMAP=1
+AM_CFLAGS		= -fPIC -DLOGCONFIG_USE_ICMAP=1
 
 
 INCLUDES		= -I$(top_builddir)/include -I$(top_srcdir)/include $(nss_CFLAGS) $(rdmacm_CFLAGS) $(ibverbs_CFLAGS)
 INCLUDES		= -I$(top_builddir)/include -I$(top_srcdir)/include $(nss_CFLAGS) $(rdmacm_CFLAGS) $(ibverbs_CFLAGS)
 
 
@@ -51,7 +51,7 @@ corosync_SOURCES	= vsf_ykd.c coroparse.c vsf_quorum.c sync.c \
 			  logsys.c cfg.c cmap.c cpg.c mon.c pload.c \
 			  logsys.c cfg.c cmap.c cpg.c mon.c pload.c \
 			  votequorum.c wd.c util.c schedwrk.c main.c \
 			  votequorum.c wd.c util.c schedwrk.c main.c \
 			  apidef.c quorum.c icmap.c timer.c \
 			  apidef.c quorum.c icmap.c timer.c \
-			  ipc_glue.c service.c mainconfig.c totemconfig.c
+			  ipc_glue.c service.c logconfig.c totemconfig.c
 corosync_LDADD		= -ltotem_pg -lcorosync_common $(LIBQB_LIBS) $(statgrab_LIBS)
 corosync_LDADD		= -ltotem_pg -lcorosync_common $(LIBQB_LIBS) $(statgrab_LIBS)
 corosync_DEPENDENCIES	= libtotem_pg.so.$(SONAME) ../common_lib/libcorosync_common.so
 corosync_DEPENDENCIES	= libtotem_pg.so.$(SONAME) ../common_lib/libcorosync_common.so
 corosync_LDFLAGS	= $(OS_DYFLAGS) -L./ -L../common_lib
 corosync_LDFLAGS	= $(OS_DYFLAGS) -L./ -L../common_lib
@@ -62,7 +62,7 @@ SHARED_LIBS		= $(lib_LIBRARIES:%.a=%.so.$(SONAME))
 SHARED_LIBS_SO		= $(SHARED_LIBS:%.so.$(SONAME)=%.so)
 SHARED_LIBS_SO		= $(SHARED_LIBS:%.so.$(SONAME)=%.so)
 SHARED_LIBS_SO_TWO	= $(SHARED_LIBS:%.so.$(SONAME)=%.so.$(SOMAJOR))
 SHARED_LIBS_SO_TWO	= $(SHARED_LIBS:%.so.$(SONAME)=%.so.$(SOMAJOR))
 
 
-noinst_HEADERS		= apidef.h mainconfig.h main.h \
+noinst_HEADERS		= apidef.h logconfig.h main.h \
 			  quorum.h service.h timer.h totemconfig.h \
 			  quorum.h service.h timer.h totemconfig.h \
 			  totemmrp.h totemnet.h totemudp.h totemiba.h totemrrp.h \
 			  totemmrp.h totemnet.h totemudp.h totemiba.h totemrrp.h \
 			  totemudpu.h totemsrp.h util.h vsf.h schedwrk.h \
 			  totemudpu.h totemsrp.h util.h vsf.h schedwrk.h \

+ 0 - 1
exec/ipc_glue.c

@@ -54,7 +54,6 @@
 #include <corosync/logsys.h>
 #include <corosync/logsys.h>
 #include <corosync/icmap.h>
 #include <corosync/icmap.h>
 
 
-#include "mainconfig.h"
 #include "sync.h"
 #include "sync.h"
 #include "timer.h"
 #include "timer.h"
 #include "main.h"
 #include "main.h"

+ 11 - 11
exec/mainconfig.c → exec/logconfig.c

@@ -38,7 +38,7 @@
 
 
 #include <corosync/totem/totem.h>
 #include <corosync/totem/totem.h>
 #include <corosync/logsys.h>
 #include <corosync/logsys.h>
-#ifdef MAINCONFIG_USE_ICMAP
+#ifdef LOGCONFIG_USE_ICMAP
 #include <corosync/icmap.h>
 #include <corosync/icmap.h>
 #define MAP_KEYNAME_MAXLEN	ICMAP_KEYNAME_MAXLEN
 #define MAP_KEYNAME_MAXLEN	ICMAP_KEYNAME_MAXLEN
 #define map_get_string(key_name, value)	icmap_get_string(key_name, value)
 #define map_get_string(key_name, value)	icmap_get_string(key_name, value)
@@ -51,7 +51,7 @@ static const char *main_logfile;
 #endif
 #endif
 
 
 #include "util.h"
 #include "util.h"
-#include "mainconfig.h"
+#include "logconfig.h"
 
 
 static char error_string_response[512];
 static char error_string_response[512];
 
 
@@ -374,7 +374,7 @@ static int corosync_main_config_set (
 		free(value);
 		free(value);
 	}
 	}
 
 
-#ifdef MAINCONFIG_USE_ICMAP
+#ifdef LOGCONFIG_USE_ICMAP
 	snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "logfile");
 	snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "logfile");
 	if (map_get_string(key_name, &value) == CS_OK) {
 	if (map_get_string(key_name, &value) == CS_OK) {
 		if (logsys_config_file_set (subsys, &error_reason, value) < 0) {
 		if (logsys_config_file_set (subsys, &error_reason, value) < 0) {
@@ -447,7 +447,7 @@ static int corosync_main_config_read_logging (
 	const char **error_string)
 	const char **error_string)
 {
 {
 	const char *error_reason;
 	const char *error_reason;
-#ifdef MAINCONFIG_USE_ICMAP
+#ifdef LOGCONFIG_USE_ICMAP
 	icmap_iter_t iter;
 	icmap_iter_t iter;
 	const char *key_name;
 	const char *key_name;
 #else
 #else
@@ -471,7 +471,7 @@ static int corosync_main_config_read_logging (
 	 * we will need 2 of these to compensate for new logging
 	 * we will need 2 of these to compensate for new logging
 	 * config format
 	 * config format
 	 */
 	 */
-#ifdef MAINCONFIG_USE_ICMAP
+#ifdef LOGCONFIG_USE_ICMAP
 	iter = icmap_iter_init("logging.logger_subsys.");
 	iter = icmap_iter_init("logging.logger_subsys.");
 	while ((key_name = icmap_iter_next(iter, NULL, NULL)) != NULL) {
 	while ((key_name = icmap_iter_next(iter, NULL, NULL)) != NULL) {
 #else
 #else
@@ -494,7 +494,7 @@ static int corosync_main_config_read_logging (
 			goto parse_error;
 			goto parse_error;
 		}
 		}
 	}
 	}
-#ifdef MAINCONFIG_USE_ICMAP
+#ifdef LOGCONFIG_USE_ICMAP
 	icmap_iter_finalize(iter);
 	icmap_iter_finalize(iter);
 #else
 #else
 	cmap_iter_finalize(cmap_handle, iter);
 	cmap_iter_finalize(cmap_handle, iter);
@@ -509,7 +509,7 @@ parse_error:
 	return (-1);
 	return (-1);
 }
 }
 
 
-#ifdef MAINCONFIG_USE_ICMAP 
+#ifdef LOGCONFIG_USE_ICMAP 
 static void main_logging_notify(
 static void main_logging_notify(
 		int32_t event,
 		int32_t event,
 		const char *key_name,
 		const char *key_name,
@@ -538,7 +538,7 @@ static void main_logging_notify(
 	corosync_main_config_read_logging(&error_string);
 	corosync_main_config_read_logging(&error_string);
 }
 }
 
 
-#ifdef MAINCONFIG_USE_ICMAP
+#ifdef LOGCONFIG_USE_ICMAP
 static void add_logsys_config_notification(void)
 static void add_logsys_config_notification(void)
 {
 {
 	icmap_track_t icmap_track = NULL;
 	icmap_track_t icmap_track = NULL;
@@ -562,8 +562,8 @@ static void add_logsys_config_notification(void)
 }
 }
 #endif
 #endif
 
 
-int corosync_main_config_read (
-#ifndef MAINCONFIG_USE_ICMAP
+int corosync_log_config_read (
+#ifndef LOGCONFIG_USE_ICMAP
 	cmap_handle_t cmap_h,
 	cmap_handle_t cmap_h,
 	const char *default_logfile,
 	const char *default_logfile,
 #endif
 #endif
@@ -571,7 +571,7 @@ int corosync_main_config_read (
 {
 {
 	const char *error_reason = error_string_response;
 	const char *error_reason = error_string_response;
 
 
-#ifndef MAINCONFIG_USE_ICMAP
+#ifndef LOGCONFIG_USE_ICMAP
 	if (!cmap_h) {
 	if (!cmap_h) {
 		error_reason = "No cmap handle";
 		error_reason = "No cmap handle";
 		return (-1);
 		return (-1);

+ 6 - 6
exec/mainconfig.h → exec/logconfig.h

@@ -32,8 +32,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
  */
-#ifndef MAINCONFIG_H_DEFINED
-#define MAINCONFIG_H_DEFINED
+#ifndef LOGCONFIG_H_DEFINED
+#define LOGCONFIG_H_DEFINED
 
 
 #include <corosync/logsys.h>
 #include <corosync/logsys.h>
 #include <corosync/list.h>
 #include <corosync/list.h>
@@ -50,14 +50,14 @@ struct dynamic_service {
 };
 };
 #define MAX_DYNAMIC_SERVICES 128
 #define MAX_DYNAMIC_SERVICES 128
 
 
-#ifdef MAINCONFIG_USE_ICMAP
-extern int corosync_main_config_read (
+#ifdef LOGCONFIG_USE_ICMAP
+extern int corosync_log_config_read (
 	const char **error_string);
 	const char **error_string);
 #else
 #else
-extern int corosync_main_config_read (
+extern int corosync_log_config_read (
 	cmap_handle_t cmap_h,
 	cmap_handle_t cmap_h,
 	const char *default_logfile,
 	const char *default_logfile,
 	const char **error_string);
 	const char **error_string);
 #endif
 #endif
 
 
-#endif /* MAINCONFIG_H_DEFINED */
+#endif /* LOGCONFIG_H_DEFINED */

+ 3 - 3
exec/main.c

@@ -111,7 +111,7 @@
 
 
 #include "quorum.h"
 #include "quorum.h"
 #include "totemsrp.h"
 #include "totemsrp.h"
-#include "mainconfig.h"
+#include "logconfig.h"
 #include "totemconfig.h"
 #include "totemconfig.h"
 #include "main.h"
 #include "main.h"
 #include "sync.h"
 #include "sync.h"
@@ -1080,7 +1080,7 @@ int main (int argc, char **argv, char **envp)
 		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
 		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
 	}
 	}
 
 
-	res = corosync_main_config_read (&error_string);
+	res = corosync_log_config_read (&error_string);
 	if (res == -1) {
 	if (res == -1) {
 		/*
 		/*
 		 * if we are here, we _must_ flush the logsys queue
 		 * if we are here, we _must_ flush the logsys queue
@@ -1092,7 +1092,7 @@ int main (int argc, char **argv, char **envp)
 		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
 		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
 		fprintf(stderr, "%s", error_string);
 		fprintf(stderr, "%s", error_string);
 		syslog (LOGSYS_LEVEL_ERROR, "%s", error_string);
 		syslog (LOGSYS_LEVEL_ERROR, "%s", error_string);
-		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
+		corosync_exit_error (COROSYNC_DONE_LOGCONFIGREAD);
 	}
 	}
 
 
 	/*
 	/*

+ 0 - 1
exec/service.c

@@ -42,7 +42,6 @@
 #include <corosync/totem/totem.h>
 #include <corosync/totem/totem.h>
 
 
 #include <corosync/corotypes.h>
 #include <corosync/corotypes.h>
-#include "mainconfig.h"
 #include "util.h"
 #include "util.h"
 #include <corosync/logsys.h>
 #include <corosync/logsys.h>
 #include <corosync/icmap.h>
 #include <corosync/icmap.h>

+ 1 - 0
exec/util.h

@@ -47,6 +47,7 @@ extern cs_time_t clust_time_now(void);
 enum e_corosync_done {
 enum e_corosync_done {
 	COROSYNC_DONE_EXIT = 0,
 	COROSYNC_DONE_EXIT = 0,
 	COROSYNC_DONE_FORK = 4,
 	COROSYNC_DONE_FORK = 4,
+	COROSYNC_DONE_LOGCONFIGREAD = 7,
 	COROSYNC_DONE_MAINCONFIGREAD = 8,
 	COROSYNC_DONE_MAINCONFIGREAD = 8,
 	COROSYNC_DONE_LOGSETUP = 9,
 	COROSYNC_DONE_LOGSETUP = 9,
 	COROSYNC_DONE_ICMAP = 12,
 	COROSYNC_DONE_ICMAP = 12,