fix rpcGetUsbEmulationState filepath (#241)

This commit is contained in:
Simon Smith 2025-03-09 14:12:27 +00:00 committed by GitHub
parent 1ec87f043f
commit 3b83f4c7a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -517,10 +517,8 @@ func rpcIsUpdatePending() (bool, error) {
return IsUpdatePending(), nil return IsUpdatePending(), nil
} }
var udcFilePath = filepath.Join("/sys/bus/platform/drivers/dwc3", udc)
func rpcGetUsbEmulationState() (bool, error) { func rpcGetUsbEmulationState() (bool, error) {
_, err := os.Stat(udcFilePath) _, err := os.Stat(filepath.Join("/sys/bus/platform/drivers/dwc3", udc))
if err != nil { if err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {
return false, nil return false, nil