[lockdev-devel] [PATCH 08/10] fix Makefile and silence a warning

Ludwig Nussel ludwig.nussel at suse.de
Wed Feb 10 11:45:38 UTC 2010


---
 Makefile      |    8 ++++----
 src/lockdev.c |    6 ++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index cddeaca..210c4a9 100644
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,8 @@ objs	= src/lockdev.o
 
 lockdev	= src/sample.c
 
-VER	= $(shell expr `pwd` : '.*-\([0-9.]*\)')
-MVER	= ${shell expr `pwd` : '.*-\([0-9]*\).[0-9]*'}
+VER	= 1.0.3
+MVER	= 1
 
 static	= ${libname}.a
 shared	= ${libname}.so.${VER}
@@ -24,8 +24,8 @@ incdir	= ${basedir}/include
 mandir	= ${basedir}/share/man
 
 CC	= gcc
-CFLAGS	= -g -O2 -Wall -pipe
-LCFLAGS	= ${CFLAGS} -fPIC -D_REENTRANT
+CFLAGS	= -g -O2 -Wall -pipe -fPIC 
+LCFLAGS	= ${CFLAGS} -D_REENTRANT
 LDLIBS	= -llockdev
 
 .PHONY: shared static perl-lib
diff --git a/src/lockdev.c b/src/lockdev.c
index c065cfa..8172638 100644
--- a/src/lockdev.c
+++ b/src/lockdev.c
@@ -141,7 +141,9 @@
 static inline	int	_dl_filename_0	( char * name, const pid_t pid);
 static inline	int	_dl_filename_1	( char * name, const struct stat * st);
 static inline	int	_dl_filename_2	( char * name, const char * dev);
+#if DEBUG
 static		void	_dl_sig_handler	( int sig);
+#endif
 static		int	_dl_get_semaphore	( int flag);
 static		int	_dl_unlock_semaphore	( int value);
 static inline	int	_dl_lock_semaphore	( void);
@@ -255,24 +257,24 @@ _dl_filename_2 (char       *name,
 #  error "lock filename build missing"
 #endif
 
+#if DEBUG
 /* handler for signals */
 static void
 _dl_sig_handler (int sig)
 {
 	signal( sig, _dl_sig_handler);
 	switch( sig ) {
-#if DEBUG
 	case SIGUSR1:
 		liblockdev_debug++;
 		break;
 	case SIGUSR2:
 		liblockdev_debug = 0;
 		break;
-#endif
 	default:
 		break;
 	}
 }
+#endif
 
 /* holds the file descriptor of the lock between the various *_semaphore function calls.
  * its positive conten doesn't tells that we lock the file.
-- 
1.6.4.2




More information about the lockdev-devel mailing list