2
* jskeepalive.c Version 1.0
4
* Copyright © 2010 Stephen Kitt
10
* This program is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU General Public License as
12
* published by the Free Software Foundation; either version 2 of the
13
* License, or (at your option) any later version.
15
* This program is distributed in the hope that it will be useful, but
16
* WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25
* Should you need to contact me, the author, you can do so by email
34
#include <linux/joystick.h>
36
int main (int argc, char **argv)
41
if (argc != 2 || !strcmp("--help", argv[1])) {
43
puts("Usage: jskeepalive <device>");
48
if ((fd = open(argv[argc - 1], O_RDONLY)) < 0) {
49
perror("jskeepalive");
54
if (read(fd, &js, sizeof(struct js_event)) != sizeof(struct js_event)) {
55
perror("\njskeepalive: error reading");