From 5ffa312614b2561beae816c6d87260afbdd0a742 Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Fri, 6 Nov 2020 01:10:08 +0000 Subject: [PATCH] return -1 if error happens --- src/util/src/tfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/src/tfile.c b/src/util/src/tfile.c index 0324a5bae8..b9a25ffe23 100644 --- a/src/util/src/tfile.c +++ b/src/util/src/tfile.c @@ -57,7 +57,7 @@ int64_t tfclose(int64_t tfd) { ssize_t tfwrite(int64_t tfd, const void *buf, size_t count) { void *p = taosAcquireRef(tsFileRsetId, tfd); - if (p == NULL) return terrno; + if (p == NULL) return -1; int fd = (int)(uintptr_t)p; @@ -71,7 +71,7 @@ ssize_t tfwrite(int64_t tfd, const void *buf, size_t count) { ssize_t tfread(int64_t tfd, void *buf, size_t count) { void *p = taosAcquireRef(tsFileRsetId, tfd); - if (p == NULL) return terrno; + if (p == NULL) return -1; int fd = (int)(uintptr_t)p; -- GitLab