From 11389fc2c7051a3e901bc0504acdd88635bb8463 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Mon, 15 Jul 2019 09:56:40 +0800 Subject: [PATCH] Fix compilation of taosdump The mode argument must be supplied when O_CREAT or O_TMPFILE is specified in flags for open(...). --- src/kit/taosdump/taosdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index aa0f429258..ac6e116060 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -614,7 +614,7 @@ int taosDumpDb(SDbInfo *dbInfo, struct arguments *arguments, FILE *fp) { 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) { fprintf(stderr, "failed to open temp file\n"); taos_free_result(result); @@ -819,7 +819,7 @@ int32_t taosDumpMetric(char *metric, struct arguments *arguments, FILE *fp) { return -1; } - fd = open(".table.tmp", O_RDWR | O_CREAT); + fd = open(".table.tmp", O_RDWR | O_CREAT, 0755); if (fd < 0) { fprintf(stderr, "failed to open temp file"); return -1; -- GitLab