[Pacemaker] [PATCH 3/8 ] ha_logd: Use C99 initializers, also correct max entity string length

Bernd Schubert bs_lists at aakef.fastmail.fm
Wed Sep 15 22:14:06 UTC 2010


ha_logd: Use C99 initializers, also correct max entity string length

C99 initializers are more easy to read. 

Signed-off-by: Bernd Schubert <bschubert at ddn.com>

diff --git a/logd/ha_logd.c b/logd/ha_logd.c
--- a/logd/ha_logd.c
+++ b/logd/ha_logd.c
@@ -87,18 +87,18 @@ static gboolean needs_shutdown = FALSE;
 static struct {
 	char		debugfile[MAXLINE];
 	char		logfile[MAXLINE];
-	char		entity[MAXLINE];
+	char		entity[MAXENTITY];
 	int		log_facility;
 	mode_t		logmode;
 	gboolean	syslogfmtmsgs;
 } logd_config =
 	{
-		"",
-		"",
-		"logd",
-		HA_LOG_FACILITY,
-		0644,
-		FALSE
+		.debugfile = "",
+		.logfile   = "",
+		.entity    = "logd",
+		.log_facility = HA_LOG_FACILITY,
+		.logmode  = 0644,
+		.syslogfmtmsgs = FALSE
 	};
 
 static void	logd_log(const char * fmt, ...) G_GNUC_PRINTF(1,2);
@@ -202,7 +202,7 @@ set_entity(const char * option)
 		return FALSE;
 	}
 	cl_log(LOG_INFO, "setting entity to %s", option);
-	strncpy(logd_config.entity, option, MAXLINE);
+	strncpy(logd_config.entity, option, MAXENTITY);
 	return TRUE;
 
 }




More information about the Pacemaker mailing list