Add udev detection to CMake

Fix tsak buid warnings
pull/2/head
Timothy Pearson 12 years ago
parent ddf6eeea68
commit 0a2a54a022

@ -44,6 +44,15 @@ if( WITH_HAL )
endif( ) endif( )
# udev (tsak)
if( BUILD_TSAK )
pkg_search_module( UDEV udev )
if( NOT UDEV_FOUND )
tde_message_fatal( "udev is required, but was not found on your system" )
endif( )
endif( )
##### check for gcc visibility support ######### ##### check for gcc visibility support #########
# FIXME # FIXME
# This should check for [T]Qt3 visibility support # This should check for [T]Qt3 visibility support

@ -282,7 +282,9 @@ void broadcast_sak()
// I highly doubt there are more than 255 VTs active at once... // I highly doubt there are more than 255 VTs active at once...
int i; int i;
for (i=0;i<255;i++) { for (i=0;i<255;i++) {
write(mPipe_fd_out, "SAK\n\r", 6); if (write(mPipe_fd_out, "SAK\n\r", 6) < 0) {
fprintf(stderr, "Unable to send SAK signal to clients\n");
}
} }
} }
@ -344,7 +346,7 @@ int main (int argc, char *argv[])
struct input_event ev[64]; struct input_event ev[64];
struct input_event event; struct input_event event;
struct input_event revev; struct input_event revev;
struct uinput_user_dev devinfo={0}; struct uinput_user_dev devinfo={{0},{0}};
int devout[MAX_KEYBOARDS], rd, i, value, size = sizeof (struct input_event); int devout[MAX_KEYBOARDS], rd, i, value, size = sizeof (struct input_event);
char name[256] = "Unknown"; char name[256] = "Unknown";
bool ctrl_down = false; bool ctrl_down = false;
@ -453,7 +455,9 @@ int main (int argc, char *argv[])
ioctl(keyboard_fds[current_keyboard], EVIOCGID, &devinfo.id); ioctl(keyboard_fds[current_keyboard], EVIOCGID, &devinfo.id);
copy_features(keyboard_fds[current_keyboard], devout[current_keyboard]); copy_features(keyboard_fds[current_keyboard], devout[current_keyboard]);
write(devout[current_keyboard],&devinfo,sizeof(devinfo)); if (write(devout[current_keyboard],&devinfo,sizeof(devinfo)) < 0) {
fprintf(stderr, "Unable to write to output device\n");
}
if (ioctl(devout[current_keyboard],UI_DEV_CREATE)<0) { if (ioctl(devout[current_keyboard],UI_DEV_CREATE)<0) {
fprintf(stderr, "Unable to create input device with UI_DEV_CREATE\n"); fprintf(stderr, "Unable to create input device with UI_DEV_CREATE\n");
if (established) if (established)
@ -490,7 +494,9 @@ int main (int argc, char *argv[])
int rrd = read(devout[current_keyboard], &revev, size); int rrd = read(devout[current_keyboard], &revev, size);
if (rrd >= size) { if (rrd >= size) {
if (revev.type == EV_LED) { if (revev.type == EV_LED) {
write(keyboard_fds[current_keyboard], &revev, sizeof(revev)); if (write(keyboard_fds[current_keyboard], &revev, sizeof(revev)) < 0) {
fprintf(stderr, "Unable to replicate LED event\n");
}
} }
} }
@ -519,9 +525,13 @@ int main (int argc, char *argv[])
if ((hide_event == false) && (ev[0].type != EV_LED) && (ev[1].type != EV_LED)) { if ((hide_event == false) && (ev[0].type != EV_LED) && (ev[1].type != EV_LED)) {
// Pass the event on... // Pass the event on...
event = ev[0]; event = ev[0];
write(devout[current_keyboard], &event, sizeof event); if (write(devout[current_keyboard], &event, sizeof event) < 0) {
fprintf(stderr, "Unable to replicate keyboard event!\n");
}
event = ev[1]; event = ev[1];
write(devout[current_keyboard], &event, sizeof event); if (write(devout[current_keyboard], &event, sizeof event) < 0) {
fprintf(stderr, "Unable to replicate keyboard event!\n");
}
} }
if (hide_event == true) { if (hide_event == true) {
// Let anyone listening to our interface know that an SAK keypress was received // Let anyone listening to our interface know that an SAK keypress was received

Loading…
Cancel
Save