fsck: clean up temporary mountpoint
We used to leave directories like /tmp/gocryptfs.fsck.104431245 behind. Let's clean up after ourselves.
This commit is contained in:
parent
a38e5988ba
commit
307dfd7f71
4
fsck.go
4
fsck.go
@ -295,6 +295,10 @@ func fsck(args *argContainer) (exitcode int) {
|
|||||||
err = srv.Unmount()
|
err = srv.Unmount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tlog.Warn.Printf("failed to unmount %q: %v", ck.mnt, err)
|
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
|
// Recursively check the root dir
|
||||||
|
Loading…
Reference in New Issue
Block a user