[Ocfs2-test-devel] [PATCH 6/7] libocfs2test: Fix Makefile

tristan.ye tristan.ye at oracle.com
Sun Aug 23 21:18:43 PDT 2009


Thank you for fixing that:-)

SOB
Tristan

Sunil Mushran Wrote:
> Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
> ---
>  programs/libocfs2test/Makefile    |   11 +++++++----
>  programs/libocfs2test/dir_ops.c   |    7 +++++--
>  programs/libocfs2test/dir_ops.h   |    4 ----
>  programs/libocfs2test/file_ops.c  |    3 +++
>  programs/libocfs2test/file_ops.h  |    3 ---
>  programs/libocfs2test/xattr_ops.c |   11 +++++++----
>  programs/libocfs2test/xattr_ops.h |    3 ---
>  7 files changed, 22 insertions(+), 20 deletions(-)
>  mode change 100755 => 100644 programs/libocfs2test/xattr_ops.c
>  mode change 100755 => 100644 programs/libocfs2test/xattr_ops.h
>
> diff --git a/programs/libocfs2test/Makefile b/programs/libocfs2test/Makefile
> index 1ec2077..8c45567 100644
> --- a/programs/libocfs2test/Makefile
> +++ b/programs/libocfs2test/Makefile
> @@ -8,7 +8,8 @@ CFLAGS += -fPIC
>  
>  CFILES =		\
>  	dir_ops.c	\
> -	xattr_ops.c
> +	xattr_ops.c	\
> +	mpi_ops.c	\
>  
>  ifdef OCFS2_TEST_REFLINK
>  CFILES +=	file_ops.c
> @@ -16,12 +17,15 @@ endif
>  
>  HFILES =		\
>  	dir_ops.h	\
> -	xattr_ops.h
> +	xattr_ops.h	\
> +	mpi_ops.h
>  
>  ifdef OCFS2_TEST_REFLINK
>  HFILES +=	file_ops.h
>  endif
>  
> +SOURCES = $(CFILES) $(HFILES)
> +
>  mpi_ops.o: mpi_ops.c mpi_ops.h
>  	$(MPICC) -c -o mpi_ops.o mpi_ops.c $(CFLAGS)
>  
> @@ -33,7 +37,6 @@ $(LIBRARIES): $(OBJS)
>  	$(AR) r $@ $^
>  	$(RANLIB) $@
>  
> -DIST_FILES = $(CFILES) $(HFILES)
> +DIST_FILES = $(SOURCES)
>  
>  include $(TOPDIR)/Postamble.make
> -
> diff --git a/programs/libocfs2test/dir_ops.c b/programs/libocfs2test/dir_ops.c
> index 23ab492..83ca749 100644
> --- a/programs/libocfs2test/dir_ops.c
> +++ b/programs/libocfs2test/dir_ops.c
> @@ -17,6 +17,9 @@
>   * General Public License for more details.
>   */
>  
> +#define _GNU_SOURCE
> +#define _XOPEN_SOURCE 600
> +#define _LARGEFILE64_SOURCE
>  #include "dir_ops.h"
>  
>  extern unsigned long num_dirents;
> @@ -334,7 +337,7 @@ int build_dir_tree(char *dirname, unsigned long entries,
>  			snprintf(fullpath, PATH_MAX, "%s/%s%ld%ld",
>  				 dirname, "F", layer, i);
>  		if (strlen(fullpath) > PATH_MAX)
> -			return;
> +			raise(SIGSEGV);		/* FIX ME */
>  
>  		fd = open(fullpath, FILE_BUFFERED_RW_FLAGS, FILE_MODE);
>  		if (fd < 0) {
> @@ -357,7 +360,7 @@ int build_dir_tree(char *dirname, unsigned long entries,
>  			snprintf(fullpath, PATH_MAX, "%s/%s%ld%ld",
>  				 dirname, "D", layer, i);
>  		if (strlen(fullpath) > PATH_MAX)
> -			return;
> +			raise(SIGSEGV);		/* FIX ME */
>  
>  		build_dir_tree(fullpath, entries, layer - 1, is_random);
>  	}
> diff --git a/programs/libocfs2test/dir_ops.h b/programs/libocfs2test/dir_ops.h
> index 3b3c289..4b27464 100644
> --- a/programs/libocfs2test/dir_ops.h
> +++ b/programs/libocfs2test/dir_ops.h
> @@ -18,10 +18,6 @@
>  #ifndef DIR_OPS_H
>  #define DIR_OPS_H
>  
> -#define _XOPEN_SOURCE 600
> -#define _GNU_SOURCE
> -#define _LARGEFILE64_SOURCE
> -
>  #include <sys/mman.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
> diff --git a/programs/libocfs2test/file_ops.c b/programs/libocfs2test/file_ops.c
> index 97d33d5..d96e749 100644
> --- a/programs/libocfs2test/file_ops.c
> +++ b/programs/libocfs2test/file_ops.c
> @@ -19,6 +19,9 @@
>   * General Public License for more details.
>   */
>  
> +#define _GNU_SOURCE
> +#define _XOPEN_SOURCE 500
> +#define _LARGEFILE64_SOURCE
>  #include "file_ops.h"
>  
>  unsigned long get_rand(unsigned long min, unsigned long max)
> diff --git a/programs/libocfs2test/file_ops.h b/programs/libocfs2test/file_ops.h
> index da16123..a5e29cc 100644
> --- a/programs/libocfs2test/file_ops.h
> +++ b/programs/libocfs2test/file_ops.h
> @@ -18,9 +18,6 @@
>  #ifndef FILE_OPS_H
>  #define FILE_OPS_H
>  
> -#define _GNU_SOURCE
> -#define _XOPEN_SOURCE 500
> -#define _LARGEFILE64_SOURCE
>  #include <unistd.h>
>  #include <errno.h>
>  #include <sys/types.h>
> diff --git a/programs/libocfs2test/xattr_ops.c b/programs/libocfs2test/xattr_ops.c
> old mode 100755
> new mode 100644
> index 742fff1..b393276
> --- a/programs/libocfs2test/xattr_ops.c
> +++ b/programs/libocfs2test/xattr_ops.c
> @@ -19,6 +19,9 @@
>   * General Public License for more details.
>   */
>  
> +#define _GNU_SOURCE
> +#define _XOPEN_SOURCE 500
> +#define _LARGEFILE64_SOURCE
>  #include "xattr_ops.h"
>  
>  extern char filename[PATH_MAX];
> @@ -242,7 +245,7 @@ int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags,
>  		if (ret < 0) {
>  			ret = errno;
>  			fprintf(stderr, "Failed at fsetxattr(%s,errno:%d,%s) "
> -				"on %s:xattr_name=%s,xattr_value_sz=%ld,"
> +				"on %s:xattr_name=%s,xattr_value_sz=%d,"
>  				"xattr_value=%s\n", prt_str, ret, strerror(ret),
>  				filename, xattr_name, strlen(xattr_value) + 1,
>  				xattr_value);
> @@ -255,7 +258,7 @@ int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags,
>  		if (ret < 0) {
>  			ret = errno;
>  			fprintf(stderr, "Failed at lsetxattr(%s,errno:%d,%s) "
> -				"on %s:xattr_name=%s,xattr_value_sz=%ld,"
> +				"on %s:xattr_name=%s,xattr_value_sz=%d,"
>  				"xattr_value=%s\n", prt_str, ret, strerror(ret),
>  				filename, xattr_name, strlen(xattr_value) + 1,
>  				xattr_value);
> @@ -268,7 +271,7 @@ int add_or_update_ea(enum FILE_TYPE ft, int fd, int ea_flags,
>  		if (ret < 0) {
>  			ret = errno;
>  			fprintf(stderr, "Failed at setxattr(%s,errno:%d,%s) "
> -				"on %s:xattr_name=%s,xattr_value_sz=%ld,"
> +				"on %s:xattr_name=%s,xattr_value_sz=%d,"
>  				"xattr_value=%s\n", prt_str, ret, strerror(ret),
>  				filename, xattr_name, strlen(xattr_value) + 1,
>  				xattr_value);
> @@ -353,7 +356,7 @@ void xattr_value_constructor(int xattr_entry_no)
>  	strlen(value_postfix_magic) -
>  	strlen(xattr_name) - 5);
>  
> -	snprintf(value_sz, 6, "%05ld", strlen(value_prefix_magic) +
> +	snprintf(value_sz, 6, "%05d", strlen(value_prefix_magic) +
>  		 strlen(xattr_name) + strlen(xattr_value) + 5 +
>  		 strlen(value_postfix_magic));
>  
> diff --git a/programs/libocfs2test/xattr_ops.h b/programs/libocfs2test/xattr_ops.h
> old mode 100755
> new mode 100644
> index e6b566b..ddf8550
> --- a/programs/libocfs2test/xattr_ops.h
> +++ b/programs/libocfs2test/xattr_ops.h
> @@ -18,9 +18,6 @@
>  #ifndef XATTR_TEST_H
>  #define XATTR_TEST_H
>  
> -#define _GNU_SOURCE
> -#define _XOPEN_SOURCE 500
> -#define _LARGEFILE64_SOURCE
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <unistd.h>
>   




More information about the Ocfs2-test-devel mailing list