main: give deferred functions a chance to run (fixes -cpuprofile)

This commit is contained in:
Jakob Unterwurzacher 2016-11-23 23:49:28 +01:00
parent 910fee244f
commit 80c50b9dbc

View File

@ -239,5 +239,10 @@ func main() {
tlog.Fatal.Printf("Usage: %s [OPTIONS] CIPHERDIR MOUNTPOINT [-o COMMA-SEPARATED-OPTIONS]", tlog.ProgramName) tlog.Fatal.Printf("Usage: %s [OPTIONS] CIPHERDIR MOUNTPOINT [-o COMMA-SEPARATED-OPTIONS]", tlog.ProgramName)
os.Exit(ErrExitUsage) os.Exit(ErrExitUsage)
} }
os.Exit(doMount(&args)) ret := doMount(&args)
if ret != 0 {
os.Exit(ret)
}
// Don't call os.Exit on success to give deferred functions a chance to
// run
} }