Fixed a warning by compiling on fedora 37

This commit is contained in:
Takeshi Nakatani 2022-11-23 12:08:55 +00:00 committed by Andrew Gaul
parent d98fdf4b2e
commit d8e4e34b74
1 changed files with 1 additions and 2 deletions

View File

@ -212,13 +212,12 @@ bool S3fsLog::LowSetLogfile(const char* pfile)
// switch new log file and close old log file if it is opened
FILE* oldfp = S3fsLog::logfp;
S3fsLog::logfp = newfp;
if(oldfp && 0 != fclose(oldfp)){
S3FS_PRN_ERR("Could not close old log file(%s).", (S3fsLog::plogfile ? S3fsLog::plogfile->c_str() : "null"));
S3fsLog::logfp = oldfp;
fclose(newfp);
return false;
}
S3fsLog::logfp = newfp;
delete S3fsLog::plogfile;
S3fsLog::plogfile = new std::string(pfile);
}