[modify for coverity scan]
This commit is contained in:
parent
f74a895feb
commit
850b1fe3fa
|
@ -170,18 +170,17 @@ static void taosGetSystemTimezone() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
|
||||||
|
|
||||||
char *lineEnd = strstr(buf, "\n");
|
char *lineEnd = strstr(buf, "\n");
|
||||||
if (lineEnd != NULL) {
|
if (lineEnd != NULL) {
|
||||||
*lineEnd = 0;
|
*lineEnd = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for CentOS system, /etc/timezone does not exist. Ignore the TZ environment variables
|
// for CentOS system, /etc/timezone does not exist. Ignore the TZ environment variables
|
||||||
if (strlen(buf) > 0) {
|
if (strlen(buf) > 0) {
|
||||||
setenv("TZ", buf, 1);
|
setenv("TZ", buf, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get and set default timezone
|
// get and set default timezone
|
||||||
tzset();
|
tzset();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue