Update of /cvsroot/linuxconsole/ruby/utils
In directory usw-pr-cvs1:/tmp/cvs-serv12814
Modified Files:
evtest.c
Log Message:
Added one more sanity check.
Index: evtest.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/utils/evtest.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- evtest.c 2001/10/02 19:25:14 1.15
+++ evtest.c 2001/10/24 11:19:28 1.16
@@ -98,9 +98,9 @@
int abs[5];
if (argc < 2) {
- printf ("Usage: evtest /dev/input/eventX\n");
- printf ("Where X = input device number\n");
- exit (1);
+ printf("Usage: evtest /dev/input/eventX\n");
+ printf("Where X = input device number\n");
+ exit(1);
}
if ((fd = open(argv[argc - 1], O_RDONLY)) < 0) {
@@ -108,7 +108,11 @@
exit(1);
}
- ioctl(fd, EVIOCGVERSION, &version);
+ if (ioctl(fd, EVIOCGVERSION, &version)) {
+ perror("evtest: can't get version");
+ exit(1);
+ }
+
printf("Input driver version is %d.%d.%d\n",
version >> 16, (version >> 8) & 0xff, version & 0xff);
|