From aa51222c2a0e1ed5aa451462fed1d769feb19864 Mon Sep 17 00:00:00 2001 From: Ash Blake Date: Tue, 18 May 2021 17:12:35 +0200 Subject: [PATCH] rosemary: usb: make sure rndis.gs4 exists when linking it --- usb/gadget/lib/UsbGadgetUtils.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usb/gadget/lib/UsbGadgetUtils.cpp b/usb/gadget/lib/UsbGadgetUtils.cpp index 6e09204..e6564e0 100644 --- a/usb/gadget/lib/UsbGadgetUtils.cpp +++ b/usb/gadget/lib/UsbGadgetUtils.cpp @@ -55,6 +55,9 @@ int linkFunction(const char* function, int index) { sprintf(functionPath, "%s%s", FUNCTIONS_PATH, function); sprintf(link, "%s%d", FUNCTION_PATH, index); + if (strcmp(function, "rndis.gs4") == 0) { + mkdir(functionPath, 0755); + } if (symlink(functionPath, link)) { ALOGE("Cannot create symlink %s -> %s errno:%d", link, functionPath, errno); return -1;