rm_r prints an error message if the directory to be deleted does not
exist. There are some opkg commands that do not error, but print the
rm_r error message re: the tmp_dir during cleanup unnecessarily.
Therefore, check if the tmp_dir exists before trying to delete it.
Signed-off-by: Shruthi Ravichandran <
shruthi.ra...@ni.com>
---
libopkg/opkg_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
index 37fcd2c..e13ebc1 100644
--- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c
@@ -906,7 +906,7 @@ void opkg_conf_deinit(void)
int i;
char **tmp;
- if (opkg_config->tmp_dir)
+ if (opkg_config->tmp_dir && file_exists(opkg_config->tmp_dir))
rm_r(opkg_config->tmp_dir);
if (opkg_config->volatile_cache && file_exists(opkg_config->cache_dir))
--
2.20.1