summaryrefslogtreecommitdiff
path: root/contrib/binreplay.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-09-17 07:56:59 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-09-17 07:56:59 -0400
commit5773220c46e95b57a8c206f1621dd5139896182e (patch)
tree7651b4b388b01ec5469f69de509a957ed70e9ef0 /contrib/binreplay.c
parent5f867ebf9204b679b71e64c97bbca9ae86112994 (diff)
downloadgpsd-5773220c46e95b57a8c206f1621dd5139896182e.tar.gz
Remove unused rate parameter.
Diffstat (limited to 'contrib/binreplay.c')
-rw-r--r--contrib/binreplay.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/contrib/binreplay.c b/contrib/binreplay.c
index ea4b9ba3..36389e09 100644
--- a/contrib/binreplay.c
+++ b/contrib/binreplay.c
@@ -1,5 +1,7 @@
/* This file is Copyright (c)2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
+ *
+ * Stuff the contents of a specified file into a specified tty.
*/
#include <sys/types.h>
#include <sys/mman.h>
@@ -28,7 +30,7 @@ int main( int argc, char **argv){
struct termios term;
char *buf, tn[32];
int ifd, ofd, sfd;
- int dflag = 0, c, sleeptime, len, rate = 0, speed = 0;
+ int dflag = 0, c, sleeptime, len, speed = 0;
while((c = getopt(argc, argv, "d:r:s:")) != -1) {
switch(c){
@@ -36,24 +38,6 @@ int main( int argc, char **argv){
dflag = 1;
strncpy(tn, optarg, sizeof(tn)-1);
break;
- case 'r':
- rate = atoi(optarg);
- switch (rate) {
- case 230400:
- case 115200:
- case 57600:
- case 38400:
- case 28800:
- case 19200:
- case 14400:
- case 9600:
- case 4800:
- break;
- default:
- fprintf(stderr, "invalid data rate: %d\n", rate);
- return 1;
- }
- break;
case 's':
speed = atoi(optarg);
switch (speed) {
@@ -82,16 +66,8 @@ int main( int argc, char **argv){
if (argc != 1)
usage();
- if (rate > speed){
- printf("data rate cannot be higher than port speed.\n");
- return 1;
- }
-
- if (0 == rate && 0 != speed)
- rate = speed;
-
- if (0 == rate && 0 == speed)
- rate = speed = 4800;
+ if (0 == speed)
+ speed = 4800;
printf("opening %s\n", argv[0]);
if ((ifd = open(argv[0], O_RDONLY, 0444)) == -1)
@@ -165,6 +141,6 @@ void spinner(int n){
}
void usage(void){
- fprintf(stderr, "usage: binreplay [-d <device>] [-r <data_rate>] [-s <port_speed>] <file>\n");
+ fprintf(stderr, "usage: binreplay [-d <device>] [-s <port_speed>] <file>\n");
exit(1);
}