diff options
author | Jakob Unterwurzacher | 2021-06-02 19:28:20 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-06-02 19:31:55 +0200 |
commit | 307dfd7f71ee1d72113e2194e9b26a53b9a36c46 (patch) | |
tree | 2e697446b00198d27998426c6577c501fbfe8f07 | |
parent | a38e5988bae3319a2c1c6745064f5785a0971d05 (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.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |