Closed notro closed 6 years ago
Thank you for this bug report. I see now where the problem is but I think it should be fixed in a little bit different way. I'll prepare a patch for both libusbgx and kernel in next week.
Hit this issue too today. Strace shows that libusbgx is also sending the 0 byte:
open("/sys/kernel/config/usb_gadget/grndis/UDC", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 27
fstat64(27, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(27, "\n\0", 2) = -1 EBUSY (Device or resource busy)
close(27) = 0
I don't think libusbgx should do that. It's just a off by one error in usbg_write_string.
I get USBG_ERROR_BUSY when using usbg_disable_gadget().
The problem is an off-by-one error in the kernel:
This also works: