#include <stdlib.h>
#include "sball.h"
-static int fd;
+static struct sball *sb;
int main(int argc, char **argv)
{
- if(!(fd = sball_open(argv[1] ? argv[1] : "/dev/ttyS0"))) {
+ if(!(sb = sball_open(argv[1] ? argv[1] : "/dev/ttyS0"))) {
fprintf(stderr, "Failed to open spaceball at %s\n", argv[1] ? argv[1] : "/dev/ttyS0");
return 1;
}
- sball_close(fd);
+ sball_close(sb);
return 0;
}