ctlsock: exit if socket cannot be created

This commit is contained in:
Jakob Unterwurzacher 2016-12-10 12:49:43 +01:00
parent 3e59041147
commit 21904cd5f0

View File

@ -178,7 +178,13 @@ func initFuseFrontend(key []byte, args *argContainer, confFile *configfile.ConfF
ctlSockBackend = fs
}
if args.ctlsock != "" {
ctlsock.CreateAndServe(args.ctlsock, ctlSockBackend)
err := ctlsock.CreateAndServe(args.ctlsock, ctlSockBackend)
if err != nil {
// TODO if the socket cannot be created, we should exit BEFORE
// asking the user for the password
tlog.Fatal.Printf("ctlsock: %v", err)
os.Exit(ErrExitMount)
}
}
pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true}
pathFs := pathfs.NewPathNodeFs(finalFs, pathFsOpts)