From 80c50b9dbcbff46cd9121f1e823fe6733a762acc Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 23 Nov 2016 23:49:28 +0100 Subject: main: give deferred functions a chance to run (fixes -cpuprofile) --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 7c39778..8ab180e 100644 --- a/main.go +++ b/main.go @@ -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 } -- cgit v1.2.3