osdl_tslib_fd = ts_fd(osdl_tslib_dev);
osdl_evdev_devs[osdl_evdev_dev_count++] = osdl_tslib_fd;
if (fstat(osdl_tslib_fd, &stat_buf) == -1)
- perror("fstat ts");
+ err_perror("fstat ts");
else
touchscreen_ino = stat_buf.st_ino;
- printf("opened tslib touchscreen\n");
+ log("opened tslib touchscreen");
}
#endif
/* touchscreen check */
if (touchscreen_ino != (dev_t)-1) {
if (fstat(fd, &stat_buf) == -1)
- perror("fstat");
+ err_perror("fstat");
else if (touchscreen_ino == stat_buf.st_ino) {
- printf("skip %s as ts\n", name);
+ log("skip %s as ts", name);
goto skip;
}
}
/* check supported events */
ret = ioctl(fd, EVIOCGBIT(0, sizeof(support)), &support);
if (ret == -1) {
- printf("in_evdev: ioctl failed on %s\n", name);
+ err_perror("in_evdev: ioctl failed on %s", name);
goto skip;
}
ret = ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits);
if (ret == -1) {
- printf("in_evdev: ioctl failed on %s\n", name);
+ err_perror("in_evdev: ioctl failed on %s", name);
goto skip;
}
osdl_evdev_devs[osdl_evdev_dev_count++] = fd;
ioctl(fd, EVIOCGNAME(sizeof(name)), name);
- printf("in_evdev: found \"%s\" with %d events (type %08x)\n",
+ log("in_evdev: found \"%s\" with %d events (type %08x)",
name, count, support);
continue;
close(fd);
}
- printf("found %d evdev device(s).\n", osdl_evdev_dev_count);
+ log("found %d evdev device(s).", osdl_evdev_dev_count);
}
void omapsdl_input_finish(void)
ret = select(fdmax + 1, &fdset, NULL, NULL, timeout);
if (ret == -1)
{
- perror("in_evdev: select failed");
+ err_perror("in_evdev: select failed");
return -1;
}
else if (ret == 0)
ret = read(fd, &ev, sizeof(ev));
if (ret < (int)sizeof(ev)) {
if (errno != EAGAIN) {
- perror("in_evdev: read failed");
+ err_perror("in_evdev: read failed");
return -1;
}
break;