diff --git a/.clang-tidy b/.clang-tidy index 593f622f4c..56961c92ce 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -36,6 +36,7 @@ Checks: ' -google-runtime-references, misc-*, -misc-const-correctness, + -misc-include-cleaner, -misc-no-recursion, -misc-redundant-expression, -misc-unused-parameters, @@ -52,6 +53,7 @@ Checks: ' -modernize-use-trailing-return-type, -modernize-use-using, performance-*, + -performance-avoid-endl, -performance-no-int-to-ptr, portability-*, readability-*, diff --git a/src/curl.cpp b/src/curl.cpp index 27221b8820..846a5b23f6 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -2139,7 +2139,10 @@ bool S3fsCurl::RemakeHandle() // rewind file struct stat st; if(b_infile){ - rewind(b_infile); + if(-1 == fseek(b_infile, 0, SEEK_SET)){ + S3FS_PRN_WARN("Could not reset position(fd=%d)", fileno(b_infile)); + return false; + } if(-1 == fstat(fileno(b_infile), &st)){ S3FS_PRN_WARN("Could not get file stat(fd=%d)", fileno(b_infile)); return false; diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 17d4ecefe1..9d34205832 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -206,8 +206,8 @@ class MpStatFlag { private: mutable pthread_mutex_t flag_lock; - bool is_lock_init; - bool has_mp_stat; + bool is_lock_init = false; + bool has_mp_stat = false; public: MpStatFlag(); @@ -221,7 +221,7 @@ class MpStatFlag bool Set(bool flag); }; -MpStatFlag::MpStatFlag() : is_lock_init(false), has_mp_stat(false) +MpStatFlag::MpStatFlag() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -273,7 +273,7 @@ class SyncFiller { private: mutable pthread_mutex_t filler_lock; - bool is_lock_init; + bool is_lock_init = false; void* filler_buff; fuse_fill_dir_t filler_func; std::set filled; @@ -290,7 +290,7 @@ class SyncFiller int SufficiencyFill(const std::vector& pathlist); }; -SyncFiller::SyncFiller(void* buff, fuse_fill_dir_t filler) : is_lock_init(false), filler_buff(buff), filler_func(filler) +SyncFiller::SyncFiller(void* buff, fuse_fill_dir_t filler) : filler_buff(buff), filler_func(filler) { if(!filler_buff || !filler_func){ S3FS_PRN_CRIT("Internal error: SyncFiller constructor parameter is critical value.");