(Not very important in practice: that code only runs once at program startup, and unless I'm doing debugging that's always just after a reboot so the Chumby will pretty reliably have plenty of memory to spare at that point. But thanks anyway.)
Gosh, I didn't know about that. My choice of poll was mostly dictated by the ALSA library API, which provides a pre-cooked set of struct pollfds for detecting when more data needs to be sent to the sound device. I suppose I could have read those and translated their contents into my poll-equivalent of choice, but it didn't seem particularly worth doing.
epoll looks like massive overkill for a job this small, anyway!
pollfds = malloc(npollfds_both * sizeof(*pollfds)); pollfds[0].fd = touchscreen_fd;Shouldn't there be a check for malloc failure in there?(Not very important in practice: that code only runs once at program startup, and unless I'm doing debugging that's always just after a reboot so the Chumby will pretty reliably have plenty of memory to spare at that point. But thanks anyway.)
pollwas mostly dictated by the ALSA library API, which provides a pre-cooked set ofstruct pollfds for detecting when more data needs to be sent to the sound device. I suppose I could have read those and translated their contents into mypoll-equivalent of choice, but it didn't seem particularly worth doing.epolllooks like massive overkill for a job this small, anyway!