Sfoglia il codice sorgente

remove hardcoded /var and use localstatedir
instead.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1854 fd59a12c-fef9-0310-b244-a6a79926bd2f

Fabio M. Di Nitto 17 anni fa
parent
commit
e8f4a4c606
10 ha cambiato i file con 11 aggiunte e 11 eliminazioni
  1. 1 1
      exec/Makefile.am
  2. 1 1
      exec/ipc.c
  3. 2 2
      exec/main.c
  4. 1 1
      exec/totemsrp.c
  5. 1 1
      lcr/Makefile.am
  6. 1 1
      lcr/uic.c
  7. 1 1
      lcr/uis.c
  8. 1 1
      lib/coroipc.c
  9. 1 1
      tools/Makefile.am
  10. 1 1
      tools/corosync-fplay.c

+ 1 - 1
exec/Makefile.am

@@ -32,7 +32,7 @@
 MAINTAINERCLEANFILES    = Makefile.in
 MAINTAINERCLEANFILES    = Makefile.in
 
 
 AM_CFLAGS	= -fPIC
 AM_CFLAGS	= -fPIC
-AM_CPPFLAGS	= -DSYSCONFDIR=\"${sysconfdir}\" -DLCRSODIR=\"${LCRSODIR}\"
+AM_CPPFLAGS	= -DSYSCONFDIR=\"${sysconfdir}\" -DLCRSODIR=\"${LCRSODIR}\" -DLOCALSTATEDIR=\"${localstatedir}\"
 INCLUDES       	= -I$(top_builddir)/include  -I$(top_srcdir)/include
 INCLUDES       	= -I$(top_builddir)/include  -I$(top_srcdir)/include
 
 
 LCR_SRC		= objdb.c vsf_ykd.c coroparse.c quorum.c vsf_quorum.c
 LCR_SRC		= objdb.c vsf_ykd.c coroparse.c quorum.c vsf_quorum.c

+ 1 - 1
exec/ipc.c

@@ -689,7 +689,7 @@ static int conn_info_create (int fd)
 #if defined(COROSYNC_LINUX)
 #if defined(COROSYNC_LINUX)
 const char *socketname = "libais.socket";
 const char *socketname = "libais.socket";
 #else
 #else
-const char *socketname = "/var/run/libais.socket";
+const char *socketname = LOCALSTATEDIR "/run/libais.socket";
 #endif
 #endif
 
 
 static int poll_handler_accept (
 static int poll_handler_accept (

+ 2 - 2
exec/main.c

@@ -169,7 +169,7 @@ static void sigsegv_handler (int num)
 {
 {
 	(void)signal (SIGSEGV, SIG_DFL);
 	(void)signal (SIGSEGV, SIG_DFL);
 	logsys_atsegv();
 	logsys_atsegv();
-	logsys_log_rec_store ("/var/lib/corosync/fdata");
+	logsys_log_rec_store (LOCALSTATEDIR "/lib/corosync/fdata");
 	raise (SIGSEGV);
 	raise (SIGSEGV);
 }
 }
 
 
@@ -177,7 +177,7 @@ static void sigabrt_handler (int num)
 {
 {
 	(void)signal (SIGABRT, SIG_DFL);
 	(void)signal (SIGABRT, SIG_DFL);
 	logsys_atsegv();
 	logsys_atsegv();
-	logsys_log_rec_store ("/var/lib/corosync/fdata");
+	logsys_log_rec_store (LOCALSTATEDIR "/lib/corosync/fdata");
 	raise (SIGABRT);
 	raise (SIGABRT);
 }
 }
 
 

+ 1 - 1
exec/totemsrp.c

@@ -718,7 +718,7 @@ int totemsrp_initialize (
 
 
 	rundir = getenv ("COROSYNC_RUN_DIR");
 	rundir = getenv ("COROSYNC_RUN_DIR");
 	if (rundir == NULL) {
 	if (rundir == NULL) {
-		rundir = "/var/lib/corosync";
+		rundir = LOCALSTATEDIR "/lib/corosync";
 	}
 	}
 	
 	
 	res = mkdir (rundir, 0700);
 	res = mkdir (rundir, 0700);

+ 1 - 1
lcr/Makefile.am

@@ -31,7 +31,7 @@
 MAINTAINERCLEANFILES    = Makefile.in
 MAINTAINERCLEANFILES    = Makefile.in
 
 
 AM_CFLAGS		= -fPIC
 AM_CFLAGS		= -fPIC
-AM_CPPFLAGS		= -DLCRSODIR=\"${LCRSODIR}\"
+AM_CPPFLAGS		= -DLCRSODIR=\"${LCRSODIR}\" -DLOCALSTATEDIR=\"${localstatedir}\"
 INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
 INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
 
 
 LCRSO			= libtest_a.lcrso libtest_b.lcrso
 LCRSO			= libtest_a.lcrso libtest_b.lcrso

+ 1 - 1
lcr/uic.c

@@ -59,7 +59,7 @@
 #ifdef COROSYNC_LINUX
 #ifdef COROSYNC_LINUX
 static const char *socketname = "lcr.socket";
 static const char *socketname = "lcr.socket";
 #else
 #else
-static const char *socketname = "/var/run/lcr.socket";
+static const char *socketname = LOCALSTATEDIR "/run/lcr.socket";
 #endif
 #endif
 
 
 static int uic_connect (int *fd);
 static int uic_connect (int *fd);

+ 1 - 1
lcr/uis.c

@@ -61,7 +61,7 @@
 #ifdef COROSYNC_LINUX
 #ifdef COROSYNC_LINUX
 static char *socketname = "lcr.socket";
 static char *socketname = "lcr.socket";
 #else
 #else
-static char *socketname = "/var/run/lcr.socket";
+static char *socketname = LOCALSTATEDIR "/run/lcr.socket";
 #endif
 #endif
 
 
 static void uis_lcr_bind (int *server_fd)
 static void uis_lcr_bind (int *server_fd)

+ 1 - 1
lib/coroipc.c

@@ -93,7 +93,7 @@ static const char *socketname = "libais.socket";
 #else
 #else
 #define AIS_SUN_LEN(a) SUN_LEN(a)
 #define AIS_SUN_LEN(a) SUN_LEN(a)
 
 
-static const char *socketname = "/var/run/libais.socket";
+static const char *socketname = LOCALSTATEDIR "/run/libais.socket";
 #endif
 #endif
 
 
 #ifdef SO_NOSIGPIPE
 #ifdef SO_NOSIGPIPE

+ 1 - 1
tools/Makefile.am

@@ -32,7 +32,7 @@
 MAINTAINERCLEANFILES    = Makefile.in
 MAINTAINERCLEANFILES    = Makefile.in
 INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
 INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
 
 
-AM_CPPFLAGS		= -DSYSCONFDIR=\"${sysconfdir}\"
+AM_CPPFLAGS		= -DSYSCONFDIR=\"${sysconfdir}\" -DLOCALSTATEDIR=\"${localstatedir}\"
 
 
 sbin_PROGRAMS		= corosync-fplay corosync-cfgtool \
 sbin_PROGRAMS		= corosync-fplay corosync-cfgtool \
 			  corosync-keygen corosync-objctl \
 			  corosync-keygen corosync-objctl \

+ 1 - 1
tools/corosync-fplay.c

@@ -456,7 +456,7 @@ int main (void)
 	int size_read;
 	int size_read;
 
 
 	flt_data = malloc ((flt_data_size + 2) * sizeof (unsigned int));
 	flt_data = malloc ((flt_data_size + 2) * sizeof (unsigned int));
-	fd = open ("/var/lib/corosync/fdata", O_RDONLY);
+	fd = open (LOCALSTATEDIR "/lib/corosync/fdata", O_RDONLY);
 	size_read = (int)read (fd, flt_data, (flt_data_size + 2) * sizeof (unsigned int));
 	size_read = (int)read (fd, flt_data, (flt_data_size + 2) * sizeof (unsigned int));
 
 
 	if (size_read != (flt_data_size + 2) * sizeof (unsigned int)) {
 	if (size_read != (flt_data_size + 2) * sizeof (unsigned int)) {