]> git.scottworley.com Git - keystroke-timestamps/blobdiff - keystroke-timestamps.c
Accept short options
[keystroke-timestamps] / keystroke-timestamps.c
index 97936c6fca37741d8774271b0c25e032e562d2bc..e0433bfa6668041b6167ec24b6caceced3927ab1 100644 (file)
@@ -27,7 +27,7 @@ int main (int argc, char **argv)
     {0,        0,                 0,            0   },
   };
   while (1) {
     {0,        0,                 0,            0   },
   };
   while (1) {
-    int c = getopt_long(argc, argv, "", long_options, NULL);
+    int c = getopt_long(argc, argv, "d:o:", long_options, NULL);
     if (c == -1) break;
     if (c == 'd') {
       device = optarg;
     if (c == -1) break;
     if (c == 'd') {
       device = optarg;
@@ -79,7 +79,7 @@ int main (int argc, char **argv)
   struct input_event i;
   while (1) {
     fd_set ready_inputs = all_inputs;
   struct input_event i;
   while (1) {
     fd_set ready_inputs = all_inputs;
-    if (select(maxfd+1, &ready_inputs, NULL, NULL, NULL) != 1) {
+    if (select(maxfd+1, &ready_inputs, NULL, NULL, NULL) < 1) {
       err(EX_IOERR, "select");
     }
     for (int fd=0; fd <= maxfd; fd++) {
       err(EX_IOERR, "select");
     }
     for (int fd=0; fd <= maxfd; fd++) {