diff --git a/HISTORY b/HISTORY index 2aaa28e..88c72ae 100644 --- a/HISTORY +++ b/HISTORY @@ -3,6 +3,7 @@ Version 5.03 2014-08-11 * network send and recv retry when error EINTR happen * support mac OS Darwin * use newest logger from libfastcommon + * patches by liangry@ucweb.com Version 5.02 2014-07-20 * corect README spell mistake diff --git a/client/client_func.c b/client/client_func.c index c1d7c49..5d5b4ca 100644 --- a/client/client_func.c +++ b/client/client_func.c @@ -447,7 +447,7 @@ bool fdfs_tracker_group_equals(TrackerServerGroup *pGroup1, \ ConnectionInfo *pServer2; ConnectionInfo *pEnd1; - if (pGroup1->server_count != pGroup1->server_count) + if (pGroup1->server_count != pGroup2->server_count) { return false; } diff --git a/client/fdfs_link_library.sh b/client/fdfs_link_library.sh deleted file mode 100755 index bab18e3..0000000 --- a/client/fdfs_link_library.sh +++ /dev/null @@ -1,28 +0,0 @@ -tmp_src_filename=_fdfs_check_bits_.c -cat < $tmp_src_filename -#include -#include -#include -int main() -{ - printf("%d\n", (int)sizeof(long)); - return 0; -} -EOF - -gcc -D_FILE_OFFSET_BITS=64 -o a.out $tmp_src_filename -OS_BITS=`./a.out` - -rm $tmp_src_filename a.out - -TARGET_LIB="/usr/local/lib" -if [ "`id -u`" = "0" ]; then - ln -fs $TARGET_LIB/libfastcommon.so.1 /usr/lib/libfastcommon.so - ln -fs $TARGET_LIB/libfdfsclient.so.1 /usr/lib/libfdfsclient.so - - if [ "$OS_BITS" = "8" ]; then - ln -fs $TARGET_LIB/libfastcommon.so.1 /usr/lib64/libfastcommon.so - ln -fs $TARGET_LIB/libfdfsclient.so.1 /usr/lib64/libfdfsclient.so - fi -fi - diff --git a/make.sh b/make.sh index a8d30d6..af695c6 100755 --- a/make.sh +++ b/make.sh @@ -58,7 +58,7 @@ EOF ENABLE_STATIC_LIB=0 ENABLE_SHARED_LIB=1 -TARGET_PREFIX=/usr/local +TARGET_PREFIX=/usr TARGET_CONF_PATH=/etc/fdfs #WITH_LINUX_SERVICE=1 diff --git a/storage/storage_dio.c b/storage/storage_dio.c index 0751bdf..0d5c42e 100644 --- a/storage/storage_dio.c +++ b/storage/storage_dio.c @@ -192,14 +192,11 @@ int storage_dio_queue_push(struct fast_task_info *pTask) int storage_dio_get_thread_index(struct fast_task_info *pTask, \ const int store_path_index, const char file_op) { - StorageClientInfo *pClientInfo; struct storage_dio_thread_data *pThreadData; struct storage_dio_context *contexts; struct storage_dio_context *pContext; int count; - pClientInfo = (StorageClientInfo *)pTask->arg; - pThreadData = g_dio_thread_data + store_path_index; if (g_disk_rw_separated) { diff --git a/test/Makefile b/test/Makefile index 8cfb09d..ffc176b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,7 +1,7 @@ .SUFFIXES: .c .o .lo COMPILE = $(CC) -g -Wall -O -D_FILE_OFFSET_BITS=64 -DDEBUG -INC_PATH = -I/usr/local/include -I/usr/local/include/fastdfs -I/usr/local/include/fastcommon +INC_PATH = -I/usr/local/include -I/usr/include/fastdfs -I/usr/include/fastcommon LIB_PATH = -L/usr/local/lib -lfdfsclient -lfastcommon TARGET_PATH = $(TARGET_PREFIX)/bin diff --git a/test/combine_result.c b/test/combine_result.c index de07270..cefaecf 100644 --- a/test/combine_result.c +++ b/test/combine_result.c @@ -167,6 +167,7 @@ static int combine_stat_by(const char *file_prefix, EntryStat *stats, const int { printf("sscanf %s fail, errno: %d, error info: %s\n", filename, errno, STRERROR(errno)); + fclose(fp); return errno != 0 ? errno : EINVAL; } } @@ -174,6 +175,7 @@ static int combine_stat_by(const char *file_prefix, EntryStat *stats, const int { printf("sscanf %s fail, errno: %d, error info: %s\n", filename, errno, STRERROR(errno)); + fclose(fp); return errno != 0 ? errno : EINVAL; } } @@ -192,6 +194,7 @@ static int combine_stat_by(const char *file_prefix, EntryStat *stats, const int if (*entry_count >= max_entries) { printf("entry count: %d >= max entries: %d\n", *entry_count, max_entries); + fclose(fp); return ENOSPC; } diff --git a/test/gen_files.c b/test/gen_files.c index 5cdd213..64e156b 100644 --- a/test/gen_files.c +++ b/test/gen_files.c @@ -55,6 +55,7 @@ int main() { printf("write file %s fail, errno: %d, error info: %s\n", files[i].filename, errno, STRERROR(errno)); + fclose(fp); return 1; } } @@ -64,6 +65,7 @@ int main() { printf("write file %s fail, errno: %d, error info: %s\n", files[i].filename, errno, STRERROR(errno)); + fclose(fp); return 1; } diff --git a/tracker/tracker_mem.c b/tracker/tracker_mem.c index 67e5728..a8063e7 100644 --- a/tracker/tracker_mem.c +++ b/tracker/tracker_mem.c @@ -2940,6 +2940,7 @@ static int tracker_mem_realloc_store_servers(FDFSGroupInfo *pGroup, \ { free(new_servers); free(new_sorted_servers); + free(new_active_servers); return result; }