diff --git a/srcs/libs/CMakeLists.txt b/srcs/libs/CMakeLists.txt index 16f58b2..5f3a02e 100644 --- a/srcs/libs/CMakeLists.txt +++ b/srcs/libs/CMakeLists.txt @@ -23,11 +23,10 @@ AUX_SOURCE_DIRECTORY(mq C_SRC) AUX_SOURCE_DIRECTORY(cmdline C_SRC) AUX_SOURCE_DIRECTORY(crypto C_SRC) AUX_SOURCE_DIRECTORY(hardware C_SRC) -AUX_SOURCE_DIRECTORY(vector C_SRC) SET(CMAKE_C_STANDARD 99) -SET_SOURCE_FILES_PROPERTIES(vector/zvector.c PROPERTIES COMPILE_FLAGS "-Wall -Wextra -flto") +SET_SOURCE_FILES_PROPERTIES(misc/zvector.c PROPERTIES COMPILE_FLAGS "-Wall -Wextra -flto") ADD_DEFINITIONS(-DBUILD_VERSION="${GIT_VERSION}" ${COMMON_DEFINE}) diff --git a/srcs/libs/configure/config.c b/srcs/libs/configure/config.c index 7e6b006..af5b4c6 100644 --- a/srcs/libs/configure/config.c +++ b/srcs/libs/configure/config.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include "uthash/uthash.h" #include "config.h" @@ -14,7 +14,6 @@ #include "user_errno.h" #include "crypto.h" #include "hardware.h" -#include "zvector/zvector.h" #define CFG_INT_VALUE(p) (p->value.longValue) #define CFG_BOOL_VALUE(p) (p->value.longValue == FALSE ? FALSE : TRUE) diff --git a/srcs/libs/hardware/disk.c b/srcs/libs/hardware/disk.c index 086b8d3..7679624 100644 --- a/srcs/libs/hardware/disk.c +++ b/srcs/libs/hardware/disk.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "misc.h" #include "user_errno.h" diff --git a/srcs/libs/hardware/ipmltools.c b/srcs/libs/hardware/ipmltools.c index cbaad14..450987b 100644 --- a/srcs/libs/hardware/ipmltools.c +++ b/srcs/libs/hardware/ipmltools.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "hardware.h" #include "user_errno.h" diff --git a/srcs/libs/hardware/memory.c b/srcs/libs/hardware/memory.c index 0d31710..6f86294 100644 --- a/srcs/libs/hardware/memory.c +++ b/srcs/libs/hardware/memory.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "hardware.h" #include "task_manager.h" diff --git a/srcs/libs/include/config.h b/srcs/libs/include/config.h index f547a6e..b8acc56 100644 --- a/srcs/libs/include/config.h +++ b/srcs/libs/include/config.h @@ -2,7 +2,7 @@ // Created by xajhu on 2021/7/1 0001. // -#include "zvector/zvector.h" +#include #ifndef DAEMON_AGENT_INCLUDE_CONFIG_H #define DAEMON_AGENT_INCLUDE_CONFIG_H diff --git a/srcs/libs/misc/alloc.h b/srcs/libs/include/sds/alloc.h similarity index 100% rename from srcs/libs/misc/alloc.h rename to srcs/libs/include/sds/alloc.h diff --git a/srcs/libs/include/sds.h b/srcs/libs/include/sds/sds.h similarity index 100% rename from srcs/libs/include/sds.h rename to srcs/libs/include/sds/sds.h diff --git a/srcs/libs/misc/sdsalloc.h b/srcs/libs/include/sds/sdsalloc.h similarity index 100% rename from srcs/libs/misc/sdsalloc.h rename to srcs/libs/include/sds/sdsalloc.h diff --git a/srcs/libs/misc/sds.c b/srcs/libs/misc/sds.c index f853ad7..fe5c04a 100644 --- a/srcs/libs/misc/sds.c +++ b/srcs/libs/misc/sds.c @@ -36,9 +36,8 @@ #include #include #include -#include "sds.h" -#include "sdsalloc.h" - +#include +#include hiredisAllocFuncs hiredisAllocFns = { .mallocFn = malloc, diff --git a/srcs/libs/vector/zvector.c b/srcs/libs/misc/zvector.c similarity index 100% rename from srcs/libs/vector/zvector.c rename to srcs/libs/misc/zvector.c diff --git a/srcs/libs/mq/mq_proto.c b/srcs/libs/mq/mq_proto.c index 3839049..33d9b92 100644 --- a/srcs/libs/mq/mq_proto.c +++ b/srcs/libs/mq/mq_proto.c @@ -3,7 +3,7 @@ // #include #include -#include +#include #include "msg_queue.h" #include "s2j/s2j.h" diff --git a/srcs/vcpe_main.c b/srcs/vcpe_main.c index 32754dd..897d279 100644 --- a/srcs/vcpe_main.c +++ b/srcs/vcpe_main.c @@ -15,7 +15,6 @@ #ifdef OPENDHCPD_ON #include "user_errno.h" -#include "libs/misc/sdsalloc.h" #endif #ifdef OPENDHCPDDNS_ON @@ -59,8 +58,7 @@ int main(int argc, char **argv) { if(ret == ERR_MENU_EXIT) { user_uninit(); exit(0); - } - if (ret != ERR_SUCCESS) { + } else if (ret != ERR_SUCCESS) { printf("Application setup error(%d), please used --help to show usage, exited!!!\n", ret); user_uninit(); exit(0); @@ -79,6 +77,7 @@ int main(int argc, char **argv) { } user_uninit(); - return 0; + + return ret; #endif }