aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-06-02 19:28:20 +0200
committerJakob Unterwurzacher2021-06-02 19:31:55 +0200
commit307dfd7f71ee1d72113e2194e9b26a53b9a36c46 (patch)
tree2e697446b00198d27998426c6577c501fbfe8f07
parenta38e5988bae3319a2c1c6745064f5785a0971d05 (diff)
fsck: clean up temporary mountpoint
We used to leave directories like /tmp/gocryptfs.fsck.104431245 behind. Let's clean up after ourselves.
-rw-r--r--fsck.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/fsck.go b/fsck.go
index 70528cf..c0db576 100644
--- a/fsck.go
+++ b/fsck.go
@@ -295,6 +295,10 @@ func fsck(args *argContainer) (exitcode int) {
err = srv.Unmount()
if err != nil {
tlog.Warn.Printf("failed to unmount %q: %v", ck.mnt, err)
+ } else {
+ if err := syscall.Rmdir(ck.mnt); err != nil {
+ tlog.Warn.Printf("cleaning up %q failed: %v", ck.mnt, err)
+ }
}
}()
// Recursively check the root dir