diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 3ad16c4cf4..8bce28d34c 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -59,12 +59,6 @@ extern int64_t tsMaxRetentWindow; extern uint32_t tsVersion; -// build info -extern char version[]; -extern char compatible_version[]; -extern char gitinfo[]; -extern char gitinfoOfInternal[]; -extern char buildinfo[]; // lossy extern char tsLossyColumns[]; diff --git a/include/util/version.h b/include/util/version.h new file mode 100644 index 0000000000..01efecc59d --- /dev/null +++ b/include/util/version.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_UTIL_VERSION_H +#define _TD_UTIL_VERSION_H + +#ifdef __cplusplus +extern "C" { +#endif + +extern char version[]; +extern char compatible_version[]; +extern char gitinfo[]; +extern char gitinfoOfInternal[]; +extern char buildinfo[]; + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_UTIL_VERSION_H*/ diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 00d629ebb2..5bcc287116 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -7,6 +7,7 @@ #include "tmsg.h" #include "tglobal.h" #include "catalog.h" +#include "version.h" #define TSC_VAR_NOT_RELEASE 1 #define TSC_VAR_RELEASED 0 diff --git a/source/dnode/mgmt/daemon/inc/dmnInt.h b/source/dnode/mgmt/daemon/inc/dmnInt.h index 7ffb0bdeb7..19ec147769 100644 --- a/source/dnode/mgmt/daemon/inc/dmnInt.h +++ b/source/dnode/mgmt/daemon/inc/dmnInt.h @@ -22,6 +22,7 @@ #include "taoserror.h" #include "tglobal.h" #include "ulog.h" +#include "version.h" #ifdef __cplusplus extern "C" { diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index df892e2242..2dfdc8dc7f 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -21,6 +21,7 @@ #include "mndStb.h" #include "mndUser.h" #include "tglobal.h" +#include "version.h" #define QUERY_ID_SIZE 20 #define QUERY_OBJ_ID_SIZE 18 diff --git a/source/os/src/osEnv.c b/source/os/src/osEnv.c index a7868323e2..b90d9fbe94 100644 --- a/source/os/src/osEnv.c +++ b/source/os/src/osEnv.c @@ -29,11 +29,11 @@ void taosUpdateTempSpace() { taosGetDiskSize(tsTempDir, &tsTempSpace.size); } void taosUpdateDataSpace() { taosGetDiskSize(tsDataDir, &tsDataSpace.size); } -bool taosLogSpaceAvailable() { return tsDataSpace.reserved > tsDataSpace.size.avail; } +bool taosLogSpaceAvailable() { return tsLogSpace.reserved < tsLogSpace.size.avail; } -bool taosTempSpaceAvailable() { return tsTempSpace.reserved > tsTempSpace.size.avail; } +bool taosTempSpaceAvailable() { return tsTempSpace.reserved < tsTempSpace.size.avail; } -bool taosDataSpaceAvailable() { return tsDataSpace.reserved > tsDataSpace.size.avail; } +bool taosDataSpaceAvailable() { return tsDataSpace.reserved < tsDataSpace.size.avail; } void taosUpdateAllSpace() { taosUpdateLogSpace(); diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 79209d09f6..f5d02df80d 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -119,6 +119,7 @@ static int32_t taosStartLog() { int32_t taosInitLog(const char *logName, int maxFiles) { if (tsLogInited) return 0; + taosUpdateLogSpace(); char fullName[PATH_MAX] = {0}; snprintf(fullName, PATH_MAX, "%s" TD_DIRSEP "%s", tsLogDir, logName); diff --git a/tools/shell/src/shellLinux.c b/tools/shell/src/shellLinux.c index 81d8c0a35b..89b477f08a 100644 --- a/tools/shell/src/shellLinux.c +++ b/tools/shell/src/shellLinux.c @@ -20,6 +20,7 @@ #include "shellCommand.h" #include "tkey.h" #include "ulog.h" +#include "version.h" #include #include