Skip to content

Commit

Permalink
modify make connection in test
Browse files Browse the repository at this point in the history
  • Loading branch information
happyfish100 committed Oct 14, 2019
1 parent 96f276a commit 3bbd1dc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions test/dfs_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions test/test_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

/*
Expand Down
8 changes: 3 additions & 5 deletions test/test_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

/*
Expand Down
6 changes: 2 additions & 4 deletions test/test_upload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 3bbd1dc

Please sign in to comment.