Removed possibility to terminate candump with an input from stdin.

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.
pull/7/head
Oliver Hartkopp 2007-02-09 09:53:16 +00:00
parent 30426b2647
commit 892c0d9e7d
1 changed files with 1 additions and 6 deletions

View File

@ -97,6 +97,7 @@ static volatile int running = 1;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "Usage: %s [can-interfaces]\n", 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, "Options: -m <mask> (default 0x00000000)\n");
fprintf(stderr, " -v <value> (default 0x00000000)\n"); fprintf(stderr, " -v <value> (default 0x00000000)\n");
fprintf(stderr, " -i <0|1> (inv_filter)\n"); fprintf(stderr, " -i <0|1> (inv_filter)\n");
@ -402,7 +403,6 @@ int main(int argc, char **argv)
while (running) { while (running) {
FD_ZERO(&rdfs); FD_ZERO(&rdfs);
FD_SET(0, &rdfs);
for (i=0; i<currmax; i++) for (i=0; i<currmax; i++)
FD_SET(s[i], &rdfs); FD_SET(s[i], &rdfs);
@ -412,11 +412,6 @@ int main(int argc, char **argv)
continue; 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 */ for (i=0; i<currmax; i++) { /* check all CAN RAW sockets */
if (FD_ISSET(s[i], &rdfs)) { if (FD_ISSET(s[i], &rdfs)) {