aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Johnston <markjdb@gmail.com>2022-06-20 12:13:18 -0400
committerAleksandr Nogikh <wp32pw@gmail.com>2022-06-24 12:52:44 +0200
commit1efedf847ecd86bc1301aafaff21f00481fd31f4 (patch)
tree671ce5a8f80e40943fad6e55569040fd15c4a4b0
parent13c353a3643c5ee9aa59bd5dc42565a59e140591 (diff)
executor: also reset flags on the parent dir if unlinking fails
-rw-r--r--executor/common.h1
-rw-r--r--pkg/csource/generated.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/executor/common.h b/executor/common.h
index 92a4d5133..f4201ca45 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -299,6 +299,7 @@ static void __attribute__((noinline)) remove_dir(const char* dir)
#if GOOS_freebsd
if (errno == EPERM) {
reset_flags(filename);
+ reset_flags(dir);
if (unlink(filename) == 0)
continue;
}
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index 570abee7f..6168f1793 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -258,6 +258,7 @@ static void __attribute__((noinline)) remove_dir(const char* dir)
#if GOOS_freebsd
if (errno == EPERM) {
reset_flags(filename);
+ reset_flags(dir);
if (unlink(filename) == 0)
continue;
}