Skip to content

Commit

Permalink
server: properly delete output-stream files
Browse files Browse the repository at this point in the history
logic inversion
  • Loading branch information
djcb committed Sep 20, 2023
1 parent 24add72 commit 1df4452
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mu-server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct OutputStream {
* longer needed.
*/
void unlink () {
if (!fname_.empty())
if (fname_.empty())
return;
if (auto&&res{::unlink(fname_.c_str())}; res != 0)
mu_warning("failed to unlink '{}'", ::strerror(res));
Expand Down Expand Up @@ -707,7 +707,7 @@ Server::Private::output_results(const QueryResults& qres, size_t batch_size) con
// structured bindings / lambda don't work with some clang.

mu_print(out, "(");
for(auto&& mi: qres) {
for (auto&& mi: qres) {

auto msg{mi.message()};
if (!msg)
Expand Down

0 comments on commit 1df4452

Please sign in to comment.