]> rtime.felk.cvut.cz Git - can-utils.git/commitdiff
Removed possibility to terminate candump with an input from stdin.
authorOliver Hartkopp <socketcan@hartkopp.net>
Fri, 9 Feb 2007 09:53:16 +0000 (09:53 +0000)
committerOliver Hartkopp <socketcan@hartkopp.net>
Fri, 9 Feb 2007 09:53:16 +0000 (09:53 +0000)
Therefore it can be used in scripts now, e.g. for CAN-frame bridging:
   candump can1 -mFFF -v123 -b can3 -s 2 &
Use CTRL-C to terminate candump.

candump.c

index a6220066f25a0555dc0c2e3892ffc3226d9b95e4..c72ff77b26fdd2a6d83f58c7265ceb1eb7f4be58 100644 (file)
--- a/candump.c
+++ b/candump.c
@@ -97,6 +97,7 @@ static volatile int running = 1;
 void print_usage(char *prg)
 {
     fprintf(stderr, "Usage: %s [can-interfaces]\n", prg);
+    fprintf(stderr, "  (use CTRL-C to terminate %s)\n", prg);
     fprintf(stderr, "Options: -m <mask>   (default 0x00000000)\n");
     fprintf(stderr, "         -v <value>  (default 0x00000000)\n");
     fprintf(stderr, "         -i <0|1>    (inv_filter)\n");
@@ -402,7 +403,6 @@ int main(int argc, char **argv)
     while (running) {
 
        FD_ZERO(&rdfs);
-       FD_SET(0, &rdfs);
        for (i=0; i<currmax; i++)
            FD_SET(s[i], &rdfs);
 
@@ -412,11 +412,6 @@ int main(int argc, char **argv)
            continue;
        }
 
-       if (FD_ISSET(0, &rdfs)) {
-           running = 0; /* stop with input from stdin */
-           getchar();
-       }
-
        for (i=0; i<currmax; i++) {  /* check all CAN RAW sockets */
 
            if (FD_ISSET(s[i], &rdfs)) {