Skip to content

Commit

Permalink
libct/cg/sd: check dbus.ErrClosed instead of isDbusError
Browse files Browse the repository at this point in the history
Signed-off-by: Kang Chen <kongchen28@gmail.com>
  • Loading branch information
chenk008 committed May 20, 2022
1 parent 8093c54 commit 39335dd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libcontainer/cgroups/systemd/dbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ func (d *dbusConnManager) resetConnection(conn *systemdDbus.Conn) {
}
}

var errDbusConnClosed = dbus.ErrClosed.Error()

// retryOnDisconnect calls op, and if the error it returns is about closed dbus
// connection, the connection is re-established and the op is retried. This helps
// with the situation when dbus is restarted and we have a stale connection.
Expand All @@ -92,7 +90,7 @@ func (d *dbusConnManager) retryOnDisconnect(op func(*systemdDbus.Conn) error) er
return err
}
err = op(conn)
if !isDbusError(err, errDbusConnClosed) {
if err != dbus.ErrClosed {
return err
}
d.resetConnection(conn)
Expand Down

0 comments on commit 39335dd

Please sign in to comment.