Message ID | 1312553358-26280-5-git-send-email-ospite@studenti.unina.it (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c index 2b0616a..d64ad6d 100644 --- a/plugins/sixaxis.c +++ b/plugins/sixaxis.c @@ -511,8 +511,14 @@ static void handle_device_plug(struct udev_device *udevice) sixpair(fd, adapter); } - if (js_num > 0) + if (js_num > 0) { + char c; + + /* wait for events before setting leds */ + if (read(fd, &c, 1) != 1) + perror("read error"); set_controller_number(fd, js_num); + } close(fd); }