diff options
author | Jakob Unterwurzacher | 2016-11-23 23:49:28 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-11-23 23:49:34 +0100 |
commit | 80c50b9dbcbff46cd9121f1e823fe6733a762acc (patch) | |
tree | 5fa6fd8c61fecf474c394ddb2bb7cb2d611f473a | |
parent | 910fee244f356593c795d19e090a6264ff95d472 (diff) |
main: give deferred functions a chance to run (fixes -cpuprofile)
-rw-r--r-- | main.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -239,5 +239,10 @@ func main() { tlog.Fatal.Printf("Usage: %s [OPTIONS] CIPHERDIR MOUNTPOINT [-o COMMA-SEPARATED-OPTIONS]", tlog.ProgramName) 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 } |