Skip to content

Commit

Permalink
Merge pull request #172 from QuentinPerez/fix-daemon-close
Browse files Browse the repository at this point in the history
daemon: fix close, don't use copy constructor
  • Loading branch information
moul committed Aug 25, 2016
2 parents 9f1b722 + 07859b4 commit b8d3d61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/config/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (hh *HostHooks) Length() int {
if hh == nil {
return 0
}
return len(hh.OnConnect) + len(hh.OnDisconnect)
return len(hh.OnConnect) + len(hh.OnDisconnect) + len(hh.BeforeConnect) + len(hh.OnConnectError)
}

// String returns the JSON output
Expand Down
8 changes: 4 additions & 4 deletions pkg/hooks/driver_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ type DaemonDriver struct {
}

// NewDaemonDriver returns a DaemonDriver instance
func NewDaemonDriver(line string) (DaemonDriver, error) {
return DaemonDriver{
func NewDaemonDriver(line string) (*DaemonDriver, error) {
return &DaemonDriver{
line: line,
}, nil
}

// Run daemons a line to the terminal
func (d DaemonDriver) Run(args RunArgs) error {
func (d *DaemonDriver) Run(args RunArgs) error {
var buff bytes.Buffer
tmpl, err := templates.New(d.line + "\n")
if err != nil {
Expand Down Expand Up @@ -51,7 +51,7 @@ func (d DaemonDriver) Run(args RunArgs) error {
}

// Close closes a running command
func (d DaemonDriver) Close() error {
func (d *DaemonDriver) Close() error {
if d.cmd == nil || d.cmd.Process == nil {
return nil
}
Expand Down

0 comments on commit b8d3d61

Please sign in to comment.