From: <ro...@us...> - 2003-12-15 21:27:12
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/swapon In directory sc8-pr-cvs1:/tmp/cvs-serv29391 Modified Files: Makefile swapon02.c Log Message: Added code to allow for environments, where MAX_SWAPFILES must be specified. Index: Makefile =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/swapon/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 4 Mar 2003 16:17:10 -0000 1.2 +++ Makefile 15 Dec 2003 21:27:08 -0000 1.3 @@ -19,7 +19,13 @@ ########################################################################### # name of file : Makefile # ########################################################################### -CFLAGS+= -I../../../../include -O -g -Wall +NEEDSPECIAL:=$(shell cat /usr/include/linux/swap.h | grep MAX_SWAPFILES | grep 32; echo $?) +ifeq ($(strip $(NEEDSPECIAL)),) +export CFLAGS+=-I../../../../include -g -Wall +else +export CFLAGS+=-I../../../../include -g -Wall -DOLDER_DISTRO_RELEASE +endif + LOADLIBES+= -L../../../../lib -lltp SRCS=$(wildcard *.c) Index: swapon02.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/swapon/swapon02.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- swapon02.c 30 Oct 2003 21:44:20 -0000 1.14 +++ swapon02.c 15 Dec 2003 21:27:08 -0000 1.15 @@ -82,12 +82,12 @@ #include <sys/types.h> #include <sys/wait.h> #include <sys/stat.h> -/* Comment these out for glibc 2.2.5 */ #include <sys/swap.h> #include <asm/page.h> #include <asm/atomic.h> -/*************************************/ +#ifdef OLDER_DISTRO_RELEASE #include <linux/swap.h> +#endif #include <fcntl.h> #include <pwd.h> #include <string.h> @@ -96,14 +96,9 @@ #include "test.h" #include "usctest.h" -/* The value below should be defined in /linux/swap.h. However, if using - * glibc 2.2.5, you should remove the include of /linux/swap.h and use the - * definition instead...due to compile problems with 2.2.5. - * Kernel > 2.4.6 - * #define MAX_SWAPFILES 32 - * Kernel < 2.4.6 - * #define MAX_SWAPFILES 8 -*/ +#ifndef OLDER_DISTRO_RELEASE +#define MAX_SWAPFILES 32 +#endif static void setup(); static void cleanup(); |