From 3923feeba74d7711472f52fa05f7ec8e8fe94eba Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 13 Dec 2024 19:02:44 +0800 Subject: [PATCH] fix:[TD-32642] set code to terrno --- source/client/src/clientMain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index d80c7df2e4..8d19cd6237 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -122,23 +122,23 @@ END: static int32_t setConnectionOption(TAOS *taos, TSDB_OPTION_CONNECTION option, const char* val){ if (taos == NULL) { - return TSDB_CODE_INVALID_PARA; + return terrno = TSDB_CODE_INVALID_PARA; } #ifdef WINDOWS if (option == TSDB_OPTION_CONNECTION_TIMEZONE){ - return TSDB_CODE_NOT_SUPPORTTED_IN_WINDOWS; + return terrno = TSDB_CODE_NOT_SUPPORTTED_IN_WINDOWS; } #endif if (option < TSDB_OPTION_CONNECTION_CLEAR || option >= TSDB_MAX_OPTIONS_CONNECTION){ - return TSDB_CODE_INVALID_PARA; + return terrno = TSDB_CODE_INVALID_PARA; } int32_t code = taos_init(); // initialize global config if (code != 0) { - return code; + return terrno = code; } STscObj *pObj = acquireTscObj(*(int64_t *)taos); @@ -208,7 +208,7 @@ static int32_t setConnectionOption(TAOS *taos, TSDB_OPTION_CONNECTION option, co END: releaseTscObj(*(int64_t *)taos); - return code; + return terrno = code; } int taos_options_connection(TAOS *taos, TSDB_OPTION_CONNECTION option, const void *arg, ...){