From 046398b1ae0905578a9c18c377f86c318924f828 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 24 May 2022 19:36:21 +0300 Subject: [PATCH] utils: avoid compiler warning --- lib/utils/mu-utils.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/utils/mu-utils.cc b/lib/utils/mu-utils.cc index ee22fe4f..7289d7a2 100644 --- a/lib/utils/mu-utils.cc +++ b/lib/utils/mu-utils.cc @@ -639,10 +639,13 @@ Mu::TempDir::~TempDir() } /* ugly */ + GError *err{}; const auto cmd{format("/bin/rm -rf '%s'", path_.c_str())}; - (void)::system(cmd.c_str()); - - g_debug("removed '%s'", path_.c_str()); + if (!g_spawn_command_line_sync(cmd.c_str(), NULL, NULL, NULL, &err)) { + g_warning("error: %s\n", err ? err->message : "?"); + g_clear_error(&err); + } else + g_debug("removed '%s'", path_.c_str()); } bool