From a3fb4fc0f8b5f046801ca939d38aad51703d93b2 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Sun, 9 Mar 2025 13:42:35 +0000 Subject: [PATCH] fix rpcGetUsbEmulationState filepath --- jsonrpc.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jsonrpc.go b/jsonrpc.go index b1b36c5..198d130 100644 --- a/jsonrpc.go +++ b/jsonrpc.go @@ -517,10 +517,8 @@ func rpcIsUpdatePending() (bool, error) { return IsUpdatePending(), nil } -var udcFilePath = filepath.Join("/sys/bus/platform/drivers/dwc3", udc) - func rpcGetUsbEmulationState() (bool, error) { - _, err := os.Stat(udcFilePath) + _, err := os.Stat(filepath.Join("/sys/bus/platform/drivers/dwc3", udc)) if err != nil { if os.IsNotExist(err) { return false, nil