diff --git a/CMakeLists.txt b/CMakeLists.txt index 938997b23ea077ae2d1466c3516c0678587c7584..d2d3f43730e8ba73b0ee6acac72ec4da343a9f92 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,8 +161,7 @@ IF (NOT DEFINED TD_CLUSTER) MESSAGE(STATUS "The current OS is Alpine, append extra flags") SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") link_libraries(/usr/lib/libargp.a) - ELSE () - ADD_DEFINITIONS(-D__USE_GNU) + ADD_DEFINITIONS(-D_ALPINE) ENDIF () ELSEIF (TD_LINUX_32) IF (NOT TD_ARM) @@ -178,8 +177,7 @@ IF (NOT DEFINED TD_CLUSTER) MESSAGE(STATUS "The current OS is Alpine, add extra flags") SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") link_library(/usr/lib/libargp.a) - ELSE () - ADD_DEFINITIONS(-D__USE_GNU) + ADD_DEFINITIONS(-D_ALPINE) ENDIF () ELSEIF (TD_WINDOWS_64) SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE) diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index 12202f95ac1d32a0e73ee5f521758b06fb509c33..bcb9c7b4e7d219f98251d6f4111675507fd97eea 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -130,7 +130,7 @@ void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { argp_parse(&argp, argc, argv, 0, 0, arguments); if (arguments->abort) { - #ifdef __USE_GNU + #ifndef _ALPINE error(10, 0, "ABORTED"); #else abort(); diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index d95a27548c94a0595349a80ab6a164e9e7239e63..4b7b073eed5216d8903e82e52ef89eccaaeb6dae 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -17,8 +17,8 @@ #include #include -#if !defined (__USE_GNU) && defined (LINUX) -#else + +#ifndef _ALPINE #include #endif #include @@ -313,7 +313,7 @@ int main(int argc, char *argv[]) { argp_parse(&argp, argc, argv, 0, 0, &arguments); if (arguments.abort) { - #ifdef __USE_GNU + #ifndef _ALPINE error(10, 0, "ABORTED"); #else abort(); diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index ba2c6c107466a103c6390087241f06d6e361577b..f722d24c26859900692b62d088f5e2a7ddfd9ef7 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -15,9 +15,8 @@ #include #include -#if !defined (__USE_GNU) && defined (LINUX) -#else -#include +#ifndef _ALPINE + #include #endif #include #include @@ -339,7 +338,7 @@ int main(int argc, char *argv[]) { argp_parse(&argp, argc, argv, 0, 0, &arguments); if (arguments.abort) { - #ifdef __USE_GNU + #ifndef _ALPINE error(10, 0, "ABORTED"); #else abort(); diff --git a/src/os/linux/inc/os.h b/src/os/linux/inc/os.h index e4b7b073f9aba4faa2bde093c75f8aabb8157a79..cf1ac769603e537444caabdbcd9576151d1aa0a3 100644 --- a/src/os/linux/inc/os.h +++ b/src/os/linux/inc/os.h @@ -23,7 +23,7 @@ extern "C" { #include #include -#ifdef __USE_GNU +#ifndef _ALPINE #include #endif @@ -232,7 +232,7 @@ void taosSetCoreDump(); void taosBlockSIGPIPE(); -#ifndef __USE_GNU +#ifdef _ALPINE typedef int(*__compar_fn_t)(const void *, const void *); void error (int, int, const char *); #ifndef PTHREAD_MUTEX_RECURSIVE_NP diff --git a/src/os/linux/src/tlinux.c b/src/os/linux/src/tlinux.c index 1591806d368e374a1550c2fa8eb7ff018c785f35..ccd6fc8a340f8132edc94f8639692eedfb2024c6 100644 --- a/src/os/linux/src/tlinux.c +++ b/src/os/linux/src/tlinux.c @@ -234,8 +234,8 @@ void *taosProcessAlarmSignal(void *tharg) { timer_t timerId; struct sigevent sevent; - - #ifndef __USE_GNU + + #ifdef _ALPINE sevent.sigev_notify = SIGEV_THREAD; sevent.sigev_value.sival_int = syscall(__NR_gettid); #else diff --git a/src/os/linux/src/tsystem.c b/src/os/linux/src/tsystem.c index afb595552ff7afd87660acdf7d563649bb9e13ac..c3b8b41c9d5536972d345efd4c6d1974ae9d77dd 100644 --- a/src/os/linux/src/tsystem.c +++ b/src/os/linux/src/tsystem.c @@ -31,7 +31,7 @@ #include #include -#ifndef __USE_GNU +#ifdef _ALPINE #include #else #include diff --git a/src/system/detail/src/vnodeImport.c b/src/system/detail/src/vnodeImport.c index 8d9e741c9831fa1432c96fd83e98539ce88f40df..f7f01a3c69946238130746106f387d536eb0bd6a 100644 --- a/src/system/detail/src/vnodeImport.c +++ b/src/system/detail/src/vnodeImport.c @@ -579,7 +579,12 @@ static int vnodeCloseImportFiles(SMeterObj *pObj, SImportHandle *pHandle) { SVnodeObj *pVnode = vnodeList + pObj->vnode; char dpath[TSDB_FILENAME_LEN] = "\0"; SCompInfo compInfo; + +#ifdef _ALPINE off_t offset = 0; +#else + __off_t offset = 0; +#endif if (pVnode->nfd > 0) { offset = lseek(pVnode->nfd, 0, SEEK_CUR);