Fix compilation of taosdump

The mode argument must be supplied when O_CREAT or O_TMPFILE is
specified in flags for open(...).
This commit is contained in:
Amos Bird 2019-07-15 09:56:40 +08:00
parent 6d12c685f7
commit 11389fc2c7
1 changed files with 2 additions and 2 deletions

View File

@ -614,7 +614,7 @@ int taosDumpDb(SDbInfo *dbInfo, struct arguments *arguments, FILE *fp) {
TAOS_FIELD *fields = taos_fetch_fields(result); TAOS_FIELD *fields = taos_fetch_fields(result);
fd = open(".table.tmp", O_RDWR | O_CREAT); fd = open(".table.tmp", O_RDWR | O_CREAT, 0755);
if (fd == -1) { if (fd == -1) {
fprintf(stderr, "failed to open temp file\n"); fprintf(stderr, "failed to open temp file\n");
taos_free_result(result); taos_free_result(result);
@ -819,7 +819,7 @@ int32_t taosDumpMetric(char *metric, struct arguments *arguments, FILE *fp) {
return -1; return -1;
} }
fd = open(".table.tmp", O_RDWR | O_CREAT); fd = open(".table.tmp", O_RDWR | O_CREAT, 0755);
if (fd < 0) { if (fd < 0) {
fprintf(stderr, "failed to open temp file"); fprintf(stderr, "failed to open temp file");
return -1; return -1;