From fbfffbc9a4f97d4cc680ef5ee4de5ee8e45eb6c9 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 26 Sep 2012 22:57:22 +0200 Subject: [PATCH] Eliminate name clash with system signal.h header file. Tried to solve the signal.h name clash by using #include_next, but seeing as this is not recommended[1] and breaks builds on some cross compilers, the files were simply renamed: signal.[ch] --> sig.[ch] [1] - http://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html Signed-off-by: Joachim Nilsson --- Makefile | 4 ++-- finit.c | 2 +- helpers.c | 2 +- plugins/initctl.c | 2 +- signal.c => sig.c | 3 +-- signal.h => sig.h | 8 ++++---- svc.c | 2 +- 7 files changed, 11 insertions(+), 12 deletions(-) rename signal.c => sig.c (99%) rename signal.h => sig.h (95%) diff --git a/Makefile b/Makefile index b282f9b7..1a5272f0 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,11 @@ ROOTDIR ?= $(shell pwd) PLUGIN_DIR ?= /lib/finit/plugins #VERSION ?= $(shell git tag -l | tail -1) -VERSION ?= 1.0 +VERSION ?= 1.1-pre EXEC = finit PKG = $(EXEC)-$(VERSION) ARCHIVE = $(PKG).tar.xz -OBJS = finit.o conf.o helpers.o signal.o svc.o plugin.o +OBJS = finit.o conf.o helpers.o sig.o svc.o plugin.o OBJS += strlcpy.o SRCS = $(OBJS:.o=.c) DEPS = $(addprefix .,$(SRCS:.c=.d)) diff --git a/finit.c b/finit.c index 52034e86..c8dd475c 100644 --- a/finit.c +++ b/finit.c @@ -33,7 +33,7 @@ #include "private.h" #include "plugin.h" #include "svc.h" -#include "signal.h" +#include "sig.h" int debug = 0; int verbose = 1; diff --git a/helpers.c b/helpers.c index 0e72bf42..784ab8b7 100644 --- a/helpers.c +++ b/helpers.c @@ -47,7 +47,7 @@ #include "finit.h" #include "helpers.h" #include "private.h" -#include "signal.h" +#include "sig.h" #define NUM_ARGS 16 #define NUM_SCRIPTS 128 /* ought to be enough for anyone */ diff --git a/plugins/initctl.c b/plugins/initctl.c index cd4d3efa..fba0fdd9 100644 --- a/plugins/initctl.c +++ b/plugins/initctl.c @@ -23,11 +23,11 @@ */ #include +#include #include #include "finit.h" #include "plugin.h" -#include "signal.h" #define INIT_MAGIC 0x03091969 #define INIT_CMD_RUNLVL 1 diff --git a/signal.c b/sig.c similarity index 99% rename from signal.c rename to sig.c index 102ada36..e88fa3fc 100644 --- a/signal.c +++ b/sig.c @@ -38,7 +38,6 @@ * It activates the kbrequest action. */ -#include #include #include @@ -46,7 +45,7 @@ #include "helpers.h" #include "plugin.h" #include "private.h" -#include "signal.h" +#include "sig.h" static int stopped = 0; diff --git a/signal.h b/sig.h similarity index 95% rename from signal.h rename to sig.h index 8325ef65..86e8f60f 100644 --- a/signal.h +++ b/sig.h @@ -22,10 +22,10 @@ * THE SOFTWARE. */ -#ifndef FINIT_SIGNAL_H_ -#define FINIT_SIGNAL_H_ +#ifndef FINIT_SIG_H_ +#define FINIT_SIG_H_ -#include_next +#include #define SYNC_SHUTDOWN "/var/lock/finit.shutdown" #define SYNC_STOPPED "/var/lock/finit.stopped" @@ -59,7 +59,7 @@ int sig_stopped (void); void sig_init (void); void sig_setup (void); -#endif /* FINIT_SIGNAL_H_ */ +#endif /* FINIT_SIG_H_ */ /** * Local Variables: diff --git a/svc.c b/svc.c index a72a4f85..d0596b77 100644 --- a/svc.c +++ b/svc.c @@ -28,7 +28,7 @@ #include "finit.h" #include "helpers.h" #include "private.h" -#include "signal.h" +#include "sig.h" #include "svc.h" /* The registered services are kept in shared memory for easy read-only access