Merge pull request #1072 from taosdata/feature/fangdoc
return if fail to open file, otherwise coredump
This commit is contained in:
commit
cbb0dd728b
|
@ -351,6 +351,11 @@ int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *fp = fopen(arguments.output_file, "a");
|
FILE *fp = fopen(arguments.output_file, "a");
|
||||||
|
if (NULL == fp) {
|
||||||
|
fprintf(stderr, "Failed to open %s for writing\n", arguments.output_file);
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
|
|
||||||
time_t tTime = time(NULL);
|
time_t tTime = time(NULL);
|
||||||
struct tm tm = *localtime(&tTime);
|
struct tm tm = *localtime(&tTime);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue