From bd6271e633c66fe47b124b616201e87f56f5f51e Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Tue, 19 Aug 2025 14:12:44 +0200 Subject: [PATCH] loopd: log correct error if daemon start fails --- loopd/daemon.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loopd/daemon.go b/loopd/daemon.go index c5f1dc70..7aab4cee 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -64,15 +64,15 @@ type ListenerCfg struct { // Daemon is the struct that holds one instance of the loop client daemon. type Daemon struct { - // To be used atomically. Declared first to optimize struct alignment. - started int32 - // swapClientServer is the embedded RPC server that satisfies the client // RPC interface. We embed this struct so the Daemon itself can be // registered to an existing grpc.Server to run as a subserver in the // same process. swapClientServer + // To be used atomically. + started int32 + // ErrChan is an error channel that users of the Daemon struct must use // to detect runtime errors and also whether a shutdown is fully // completed. @@ -168,7 +168,7 @@ func (d *Daemon) Start() error { // anything goes wrong now, we need to cleanly shut down again. startErr := d.startWebServers() if startErr != nil { - errorf("Error while starting daemon: %v", err) + errorf("Error while starting daemon: %v", startErr) d.Stop() stopErr := <-d.ErrChan if stopErr != nil {