Skip to content

Commit

Permalink
Check for fclose returning 0 in rosbag_storage (#1750)
Browse files Browse the repository at this point in the history
fix #1743
  • Loading branch information
artivis authored and dirk-thomas committed Aug 4, 2020
1 parent 4791305 commit 08150d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/rosbag_storage/src/chunked_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ void ChunkedFile::open(string const& filename, string const& mode) {
file_ = fopen(filename.c_str(), "w+b");
#endif
else {
fclose(file_);
if (fclose(file_) != 0)
throw BagIOException((format("Error closing file: %1%") % filename.c_str()).str());

// open existing file for update
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
fopen_s( &file_, filename.c_str(), "r+b" );
Expand Down

0 comments on commit 08150d9

Please sign in to comment.