modify make connection in test
parent
96f276a218
commit
3bbd1dc727
|
|
@ -5,8 +5,8 @@ INC_PATH = -I/usr/local/include
|
|||
LIB_PATH = -L/usr/local/lib -lfdfsclient -lfastcommon
|
||||
TARGET_PATH = $(TARGET_PREFIX)/bin
|
||||
|
||||
#SHARED_OBJS = common_func.o dfs_func.o
|
||||
SHARED_OBJS = common_func.o dfs_func_pc.o
|
||||
SHARED_OBJS = common_func.o dfs_func.o
|
||||
#SHARED_OBJS = common_func.o dfs_func_pc.o
|
||||
|
||||
ALL_OBJS = $(SHARED_OBJS)
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ int upload_file(const char *file_buff, const int file_size, char *file_id, char
|
|||
return result;
|
||||
}
|
||||
|
||||
if ((pStorageServer=tracker_connect_server(&storageServer, &result)) \
|
||||
if ((pStorageServer=tracker_make_connection(&storageServer, &result)) \
|
||||
== NULL)
|
||||
{
|
||||
tracker_close_connection(pTrackerServer);
|
||||
|
|
@ -87,7 +87,7 @@ int download_file(const char *file_id, int *file_size, char *storage_ip)
|
|||
return result;
|
||||
}
|
||||
|
||||
if ((pStorageServer=tracker_connect_server(&storageServer, &result)) \
|
||||
if ((pStorageServer=tracker_make_connection(&storageServer, &result)) \
|
||||
== NULL)
|
||||
{
|
||||
tracker_close_connection(pTrackerServer);
|
||||
|
|
@ -125,7 +125,7 @@ int delete_file(const char *file_id, char *storage_ip)
|
|||
return result;
|
||||
}
|
||||
|
||||
if ((pStorageServer=tracker_connect_server(&storageServer, &result)) \
|
||||
if ((pStorageServer=tracker_make_connection(&storageServer, &result)) \
|
||||
== NULL)
|
||||
{
|
||||
tracker_close_connection(pTrackerServer);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "fastcommon/shared_func.h"
|
||||
#include "fastcommon/logger.h"
|
||||
#include "test_types.h"
|
||||
#include "common_func.h"
|
||||
|
|
@ -119,10 +120,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (daemon(1, 1) != 0)
|
||||
{
|
||||
return errno != 0 ? errno : EFAULT;
|
||||
}
|
||||
daemon_init(false);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "fastcommon/logger.h"
|
||||
#include "fastcommon/common_define.h"
|
||||
#include "fastcommon/shared_func.h"
|
||||
#include "fastcommon/logger.h"
|
||||
#include "test_types.h"
|
||||
#include "common_func.h"
|
||||
#include "dfs_func.h"
|
||||
|
|
@ -127,10 +128,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (daemon(1, 1) != 0)
|
||||
{
|
||||
return errno != 0 ? errno : EFAULT;
|
||||
}
|
||||
daemon_init(false);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include "fastcommon/common_define.h"
|
||||
#include "fastcommon/shared_func.h"
|
||||
#include "fastcommon/logger.h"
|
||||
#include "test_types.h"
|
||||
#include "common_func.h"
|
||||
|
|
@ -121,10 +122,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (daemon(1, 1) != 0)
|
||||
{
|
||||
return errno != 0 ? errno : EFAULT;
|
||||
}
|
||||
daemon_init(false);
|
||||
#endif
|
||||
|
||||
memset(&storages, 0, sizeof(storages));
|
||||
|
|
|
|||
Loading…
Reference in New Issue