Skip to content

Commit

Permalink
main: give deferred functions a chance to run (fixes -cpuprofile)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfjakob committed Nov 23, 2016
1 parent 910fee2 commit 80c50b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 80c50b9

Please sign in to comment.