Skip to content

Commit 80c50b9

Browse files
committed
main: give deferred functions a chance to run (fixes -cpuprofile)
1 parent 910fee2 commit 80c50b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,5 +239,10 @@ func main() {
239239
tlog.Fatal.Printf("Usage: %s [OPTIONS] CIPHERDIR MOUNTPOINT [-o COMMA-SEPARATED-OPTIONS]", tlog.ProgramName)
240240
os.Exit(ErrExitUsage)
241241
}
242-
os.Exit(doMount(&args))
242+
ret := doMount(&args)
243+
if ret != 0 {
244+
os.Exit(ret)
245+
}
246+
// Don't call os.Exit on success to give deferred functions a chance to
247+
// run
243248
}

0 commit comments

Comments
 (0)