File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/plugins/output/fds/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1717#include < libgen.h>
1818#include " Storage.hpp"
1919
20+ const std::string TMP_SUFFIX = " .tmp" ;
21+
2022Storage::Storage (ipx_ctx_t *ctx, const Config &cfg) : m_ctx(ctx), m_path(cfg.m_path)
2123{
2224 // Check if the directory exists
@@ -58,7 +60,7 @@ Storage::window_new(time_t ts)
5860 window_close ();
5961
6062 // Open new file
61- const std::string new_file = filename_gen (ts) + " .tmp " ;
63+ const std::string new_file = filename_gen (ts) + TMP_SUFFIX ;
6264 m_file_name = new_file;
6365 std::unique_ptr<char , decltype (&free)> new_file_cpy (strdup (new_file.c_str ()), &free);
6466
@@ -90,7 +92,7 @@ Storage::window_close()
9092 m_file.reset ();
9193 m_session2params.clear ();
9294 if (file_opened) {
93- std::string new_file_name (m_file_name.begin (), m_file_name.end () - std::string ( " .tmp " ) .size ());
95+ std::string new_file_name (m_file_name.begin (), m_file_name.end () - TMP_SUFFIX .size ());
9496 std::rename (m_file_name.c_str (), new_file_name.c_str ());
9597 m_file_name.clear ();
9698 }
You can’t perform that action at this time.
0 commit comments