From 9c7bc4f5da67a630fe543bd8bdf5d1aaf2acef99 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Thu, 17 Mar 2011 19:01:02 +0000 Subject: libglusterfs/compat.h: Fix build warning in dirent_size(). Signed-off-by: Vikas Gorur Signed-off-by: Vijay Bellur BUG: 2550 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2550 --- libglusterfs/src/compat.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h index 059f67131c2..a6f1f01bd28 100644 --- a/libglusterfs/src/compat.h +++ b/libglusterfs/src/compat.h @@ -319,18 +319,21 @@ size_t strnlen(const char *string, size_t maxlen); static inline int32_t dirent_size (struct dirent *entry) { + int32_t size = -1; + #ifdef GF_BSD_HOST_OS - return GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_namlen); + size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_namlen); #endif #ifdef GF_DARWIN_HOST_OS - return GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_namlen); + size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_namlen); #endif #ifdef GF_LINUX_HOST_OS - return GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_reclen); + size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_reclen); #endif #ifdef GF_SOLARIS_HOST_OS - return GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_reclen); + size = GF_DIR_ALIGN (24 /* FIX MEEEE!!! */ + entry->d_reclen); #endif + return size; } -- cgit