Skip to content

Commit bd6271e

Browse files
committed
loopd: log correct error if daemon start fails
1 parent cc26813 commit bd6271e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

loopd/daemon.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ type ListenerCfg struct {
6464

6565
// Daemon is the struct that holds one instance of the loop client daemon.
6666
type Daemon struct {
67-
// To be used atomically. Declared first to optimize struct alignment.
68-
started int32
69-
7067
// swapClientServer is the embedded RPC server that satisfies the client
7168
// RPC interface. We embed this struct so the Daemon itself can be
7269
// registered to an existing grpc.Server to run as a subserver in the
7370
// same process.
7471
swapClientServer
7572

73+
// To be used atomically.
74+
started int32
75+
7676
// ErrChan is an error channel that users of the Daemon struct must use
7777
// to detect runtime errors and also whether a shutdown is fully
7878
// completed.
@@ -168,7 +168,7 @@ func (d *Daemon) Start() error {
168168
// anything goes wrong now, we need to cleanly shut down again.
169169
startErr := d.startWebServers()
170170
if startErr != nil {
171-
errorf("Error while starting daemon: %v", err)
171+
errorf("Error while starting daemon: %v", startErr)
172172
d.Stop()
173173
stopErr := <-d.ErrChan
174174
if stopErr != nil {

0 commit comments

Comments
 (0)