summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-11-23 23:49:28 +0100
committerJakob Unterwurzacher2016-11-23 23:49:34 +0100
commit80c50b9dbcbff46cd9121f1e823fe6733a762acc (patch)
tree5fa6fd8c61fecf474c394ddb2bb7cb2d611f473a /main.go
parent910fee244f356593c795d19e090a6264ff95d472 (diff)
main: give deferred functions a chance to run (fixes -cpuprofile)
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 6 insertions, 1 deletions
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
}