mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-08 14:42:02 +00:00
sys: Runs rm -rf using run_command()
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
+1
-4
@@ -40,16 +40,13 @@
|
||||
static int create_staging_renamedir(char *rename_tmpdir)
|
||||
{
|
||||
int ret;
|
||||
char *rmcommand = NULL;
|
||||
|
||||
string_or_die(&rmcommand, "rm -fr %s", rename_tmpdir);
|
||||
if (!system(rmcommand)) {
|
||||
if (rm_rf(rename_tmpdir) != 0) {
|
||||
/* Not fatal but pretty scary, likely to really fail at the
|
||||
* next command too. Pass for now as printing may just cause
|
||||
* confusion */
|
||||
;
|
||||
}
|
||||
free_string(&rmcommand);
|
||||
|
||||
ret = mkdir(rename_tmpdir, S_IRWXU);
|
||||
if (ret == -1 && errno != EEXIST) {
|
||||
|
||||
@@ -152,3 +152,8 @@ int mkdir_p(const char *dir)
|
||||
{
|
||||
return run_command_quiet("/bin/mkdir", "-p", dir, NULL);
|
||||
}
|
||||
|
||||
int rm_rf(const char *file)
|
||||
{
|
||||
return run_command_quiet("/bin/rm", "-rf", file, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user