summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
authorVáclav Pavlín <vpavlin@redhat.com>2013-03-27 15:16:35 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-27 11:59:14 -0400
commitebf4fb3d368732d9f41cb40e3084182c04e731b2 (patch)
treea365451e7f915b0c8442faad228d5ebcc390fc80 /src/core/execute.c
parent3483fab948f0e75d662f9a7abb8cd1937998c255 (diff)
core: check return value of rm_rf_dangerous and warn if it fails
Diffstat (limited to 'src/core/execute.c')
-rw-r--r--src/core/execute.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index bc876a3292..6aa0083bc0 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1559,10 +1559,19 @@ void exec_context_tmp_dirs_done(ExecContext *c) {
for(dirp = dirs; *dirp; dirp++) {
char *dir;
- rm_rf_dangerous(*dirp, false, true, false);
+ int r;
+ r = rm_rf_dangerous(*dirp, false, true, false);
dir = dirname(*dirp);
- rmdir(dir);
+ if (r < 0)
+ log_warning("Failed to remove content of temporary directory %s: %s",
+ dir, strerror(-r));
+ else {
+ r = rmdir(dir);
+ if (r < 0)
+ log_warning("Failed to remove temporary directory %s: %s",
+ dir, strerror(-r));
+ }
free(*dirp);
}