AristoChen / usb-proxy

A USB proxy based on raw-gadget and libusb
Apache License 2.0
136 stars 29 forks source link

hotplug_callback bug #17

Open wzw88486969 opened 6 months ago

wzw88486969 commented 6 months ago
int hotplug_callback(struct libusb_context *ctx __attribute__((unused)),
            struct libusb_device *dev __attribute__((unused)),
            libusb_hotplug_event envet __attribute__((unused)),
            void *user_data __attribute__((unused))) {
    printf("Hotplug event\n");

    kill(0, SIGINT);
    return 0;
}

Suggest replacing the kill 0 line with another one. I have integrated it into the Android system. When plugging in or unplugging peripherals, it may send a SIGINT signal to the init 0 process, causing system issues.