diff --git a/client/test/Makefile.in b/client/test/Makefile.in index 3910089..4a5a55e 100644 --- a/client/test/Makefile.in +++ b/client/test/Makefile.in @@ -1,7 +1,8 @@ .SUFFIXES: .c .o COMPILE = $(CC) $(CFLAGS) -INC_PATH = -I/usr/include/fastcommon -I/usr/include/fastdfs +INC_PATH = -I/usr/include/fastcommon -I/usr/include/fastdfs \ + -I/usr/local/include/fastcommon -I/usr/local/include/fastdfs LIB_PATH = -L/usr/local/lib -lfastcommon -lfdfsclient $(LIBS) TARGET_PATH = $(TARGET_PATH) diff --git a/client/test/fdfs_monitor.c b/client/test/fdfs_monitor.c index 7978b29..67afd9f 100644 --- a/client/test/fdfs_monitor.c +++ b/client/test/fdfs_monitor.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "fastcommon/sockopt.h" #include "fastcommon/logger.h" @@ -25,8 +26,11 @@ static int list_all_groups(const char *group_name); static void usage(char *argv[]) { - printf("Usage: %s [-h ] [list|delete|set_trunk_server " \ - "[storage_id]]\n", argv[0]); + printf("Usage: %s [-h ] " + "[list|delete|set_trunk_server [storage_id]]\n" + "\tthe tracker server format: host[:port], " + "the tracker default port is %d\n\n", + argv[0], FDFS_TRACKER_SERVER_DEF_PORT); } int main(int argc, char *argv[]) @@ -115,21 +119,20 @@ int main(int argc, char *argv[]) else { int i; - char ip_addr[IP_ADDRESS_SIZE]; + ConnectionInfo conn; - *ip_addr = '\0'; - if (getIpaddrByName(tracker_server, ip_addr, sizeof(ip_addr)) \ - == INADDR_NONE) + if ((result=conn_pool_parse_server_info(tracker_server, &conn, + FDFS_TRACKER_SERVER_DEF_PORT)) != 0) { - printf("resolve ip address of tracker server: %s " \ - "fail!\n", tracker_server); - return 2; + printf("resolve ip address of tracker server: %s " + "fail!, error info: %s\n", tracker_server, hstrerror(h_errno)); + return result; } for (i=0; i