version 1.30, 2010/06/29 23:32:52 |
version 1.31, 2010/06/29 23:38:05 |
|
|
|
|
if (argc < 2) |
if (argc < 2) |
cuusage(); |
cuusage(); |
DV = NULL; |
|
setnumber(value(BAUDRATE), DEFBR); |
setnumber(value(BAUDRATE), DEFBR); |
parity = 0; /* none */ |
parity = 0; /* none */ |
|
|
|
|
while ((ch = getopt(argc, argv, "l:s:htoe")) != -1) { |
while ((ch = getopt(argc, argv, "l:s:htoe")) != -1) { |
switch (ch) { |
switch (ch) { |
case 'l': |
case 'l': |
if (DV != NULL) { |
if (value(DEVICE) != NULL) { |
fprintf(stderr, |
fprintf(stderr, |
"%s: cannot specify multiple -l options\n", |
"%s: cannot specify multiple -l options\n", |
__progname); |
__progname); |
exit(3); |
exit(3); |
} |
} |
if (strchr(optarg, '/')) |
if (strchr(optarg, '/')) |
DV = optarg; |
value(DEVICE) = optarg; |
else |
else { |
if (asprintf(&DV, "%s%s", _PATH_DEV, optarg) == -1) |
if (asprintf(&value(DEVICE), |
|
"%s%s", _PATH_DEV, optarg) == -1) |
err(3, "asprintf"); |
err(3, "asprintf"); |
|
} |
break; |
break; |
case 's': |
case 's': |
baudrate = (int)strtonum(optarg, 0, INT_MAX, &errstr); |
baudrate = (int)strtonum(optarg, 0, INT_MAX, &errstr); |