1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-14 05:57:40 +03:00

core: check return value of rm_rf_dangerous and warn if it fails

This commit is contained in:
Václav Pavlín 2013-03-27 15:16:35 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 3483fab948
commit ebf4fb3d36

View File

@ -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);
}