summaryrefslogtreecommitdiff
diff options
-rw-r--r--daemon/daemon.go9
-rw-r--r--daemon/daemon_test.go4
2 files changed, 5 insertions, 8 deletions
diff --git a/daemon/daemon.go b/daemon/daemon.go
index 13e57c5bc9..1fa97cc822 100644
--- a/daemon/daemon.go
+++ b/daemon/daemon.go
@@ -79,7 +79,7 @@ type Daemon struct {
// set to what kind of restart was requested (if any)
requestedRestart restart.RestartType
// reboot info needed to handle reboots
- rebootInfo boot.RebootInfo
+ rebootInfo *boot.RebootInfo
// set to remember that we need to exit the daemon in a way that
// prevents systemd from restarting it
restartSocket bool
@@ -397,10 +397,7 @@ func (d *Daemon) HandleRestart(t restart.RestartType, rebootInfo *boot.RebootInf
logger.Noticef("%s", err)
}
}
- d.rebootInfo = boot.RebootInfo{}
- if rebootInfo != nil {
- d.rebootInfo = *rebootInfo
- }
+ d.rebootInfo = rebootInfo
// die when asked to restart (systemd should get us back up!) etc
switch t {
@@ -578,7 +575,7 @@ func (d *Daemon) Stop(sigCh chan<- os.Signal) error {
}
if needsFullShutdown {
- return d.doReboot(sigCh, d.requestedRestart, &rebootInfo, immediateShutdown, rebootWaitTimeout)
+ return d.doReboot(sigCh, d.requestedRestart, rebootInfo, immediateShutdown, rebootWaitTimeout)
}
if d.restartSocket {
diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go
index 41e28707c2..438128534c 100644
--- a/daemon/daemon_test.go
+++ b/daemon/daemon_test.go
@@ -1147,7 +1147,7 @@ func (s *daemonSuite) TestRestartShutdownWithSigtermInBetween(c *check.C) {
c.Check(ri, check.IsNil)
case 2:
c.Check(d, check.Equals, 1*time.Minute)
- c.Check(ri, check.DeepEquals, &boot.RebootInfo{})
+ c.Check(ri, check.IsNil)
default:
c.Error("reboot called more times than expected")
}
@@ -1200,7 +1200,7 @@ func (s *daemonSuite) TestRestartShutdown(c *check.C) {
c.Check(ri, check.IsNil)
case 2:
c.Check(d, check.Equals, 1*time.Minute)
- c.Check(ri, check.DeepEquals, &boot.RebootInfo{})
+ c.Check(ri, check.IsNil)
default:
c.Error("reboot called more times than expected")
}