Move "Debug output enabled" after forkChild() to remove duplicate output

This commit is contained in:
Jakob Unterwurzacher 2015-11-15 13:56:01 +01:00
parent 7a2ab0b233
commit 09499be6e9

View File

@ -144,10 +144,6 @@ func main() {
"successful mount - used internally for daemonization") "successful mount - used internally for daemonization")
flagSet.Parse(os.Args[1:]) flagSet.Parse(os.Args[1:])
if args.debug {
cryptfs.Debug.Enable()
cryptfs.Debug.Printf("Debug output enabled\n")
}
// By default, let the child handle everything. // By default, let the child handle everything.
// The parent *could* handle operations that do not require backgrounding by // The parent *could* handle operations that do not require backgrounding by
// itself, but that would make the code paths more complicated. // itself, but that would make the code paths more complicated.
@ -160,6 +156,10 @@ func main() {
printVersion() printVersion()
os.Exit(0) os.Exit(0)
} }
if args.debug {
cryptfs.Debug.Enable()
cryptfs.Debug.Printf("Debug output enabled\n")
}
// Every operation below requires CIPHERDIR. Check that we have it. // Every operation below requires CIPHERDIR. Check that we have it.
if flagSet.NArg() >= 1 { if flagSet.NArg() >= 1 {
args.cipherdir, _ = filepath.Abs(flagSet.Arg(0)) args.cipherdir, _ = filepath.Abs(flagSet.Arg(0))