Skip to content

Commit

Permalink
refactor: Use proper disconnect sequence as described in NBD protocol…
Browse files Browse the repository at this point in the history
… documentation
  • Loading branch information
pojntfx committed Apr 16, 2023
1 parent fbb9ce9 commit 3e31a6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/client/nbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func Disconnect(device *os.File) error {
if _, _, err := syscall.Syscall(
syscall.SYS_IOCTL,
device.Fd(),
ioctl.TRANSMISSION_IOCTL_DISCONNECT,
ioctl.TRANSMISSION_IOCTL_CLEAR_QUE,
0,
); err != 0 {
return err
Expand All @@ -238,7 +238,7 @@ func Disconnect(device *os.File) error {
if _, _, err := syscall.Syscall(
syscall.SYS_IOCTL,
device.Fd(),
ioctl.TRANSMISSION_IOCTL_CLEAR_SOCK,
ioctl.TRANSMISSION_IOCTL_DISCONNECT,
0,
); err != 0 {
return err
Expand All @@ -247,7 +247,7 @@ func Disconnect(device *os.File) error {
if _, _, err := syscall.Syscall(
syscall.SYS_IOCTL,
device.Fd(),
ioctl.TRANSMISSION_IOCTL_CLEAR_QUE,
ioctl.TRANSMISSION_IOCTL_CLEAR_SOCK,
0,
); err != 0 {
return err
Expand Down

0 comments on commit 3e31a6f

Please sign in to comment.