Skip to content

Commit

Permalink
fix: disable libusb auto detach on osx
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed Feb 4, 2024
1 parent ee32b01 commit cae4b33
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions printing/usb/usb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"image"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -88,8 +89,10 @@ func (c *USB) openDevice(vendor int64, product int64, endpoint int) error {
return err
}

if err := device.SetAutoDetach(true); err != nil {
return err
if runtime.GOOS != "darwin" {
if err := device.SetAutoDetach(true); err != nil {
return err
}
}

iface, done, err := device.DefaultInterface()
Expand Down

0 comments on commit cae4b33

Please sign in to comment.