From 8255a2b0bb5a04e5ef361aad77531d77d996403b Mon Sep 17 00:00:00 2001 From: Sudheer Shanka Date: Mon, 25 Feb 2019 12:21:23 -0800 Subject: [PATCH] Ignore if the dir we are trying remove doesn't exist. Fixes: 126208830 Test: manual Change-Id: I34788ebb2dd42e62ee3061f7d81dc03047048c3b --- Utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils.cpp b/Utils.cpp index 6e0fe21..45183ed 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -902,7 +902,7 @@ status_t DeleteDirContentsAndDir(const std::string& pathname) { if (res < 0) { return res; } - if (rmdir(pathname.c_str()) != 0) { + if (TEMP_FAILURE_RETRY(rmdir(pathname.c_str())) < 0 && errno != ENOENT) { PLOG(ERROR) << "rmdir failed on " << pathname; return -errno; }