From: git Date: Mon, 2 Mar 2026 08:20:35 +0000 (-0500) Subject: minor tweaks and fixes X-Git-Url: https://git.datadissipation.net/?a=commitdiff_plain;h=b511edf3f32836b17844225e1f27a8e395526746;p=ust.git minor tweaks and fixes --- diff --git a/config.def.h b/config.def.h index 44583ca..c7637dc 100644 --- a/config.def.h +++ b/config.def.h @@ -60,7 +60,7 @@ int verbose = 0; /*(0|1)*/ * tty* - 'dial-in' device, blocks opening until a connection is established * ttyU* - USB variant */ -char line[16] = "/dev/cuau0"; +char line[64] = "/dev/cuau0"; /* * baud is usually configurable to standard values only, diff --git a/ust.c b/ust.c index 7d4918c..df002ce 100644 --- a/ust.c +++ b/ust.c @@ -456,6 +456,7 @@ readport(void *unused) { Sizes msizes; struct timespec ts; + ts.tv_sec = sreaddelay; ts.tv_nsec = nsreaddelay; msizes.sizesm = scratchrsz; @@ -561,7 +562,7 @@ rmchar(char *buff, ssize_t size, int *scratch, const Args *args) } void -interchck() +interchck(void) { if (interactive) { if (gettermattr(STDIN_FILENO, &origterm) < 0 ) @@ -602,7 +603,7 @@ interchck() } void -cechck() +cechck(void) { if ((!half || !canonical) && interactive) { newterm.c_lflag |= ECHO; @@ -871,7 +872,7 @@ main(int argc, char *argv[]) case 'd': tl = strtol(optarg, &endptr, 10); if (errno != 0 || *endptr != '\0' || t < 0) { - fprintf(stderr, "%s: invalid character delay: %s\n", argv[0], optarg); + fprintf(stderr, "invalid character delay: %s\n", optarg); goto ustusage; } else { chardelay = tl; @@ -879,7 +880,7 @@ main(int argc, char *argv[]) break; case 'D': if (optarg[1] != '\0' || !(optarg[0] >= '5' && optarg[0] <= '8')) { - fprintf(stderr, "%s: invalid number of data bits: %s\n", argv[0], optarg); + fprintf(stderr, "invalid number of data bits: %s\n", optarg); goto ustusage; } else { datab = optarg[0]; @@ -907,11 +908,11 @@ main(int argc, char *argv[]) stopb ^= 1; break; case 'l': if (devset) { - fprintf(stderr, "%s: cannot specify multiple devices\n", argv[0]); + fprintf(stderr, "cannot specify multiple devices\n"); goto ustusage; } - if (strlen(optarg) > 10) { - fprintf(stderr, "%s: device name too long\n", argv[0]); + if (strlen(optarg) > 58) { + fprintf(stderr, "device name too long\n"); goto ustusage; } if (strchr(optarg, '/')) { @@ -949,8 +950,7 @@ main(int argc, char *argv[]) " [--canonical|-c] [--echo|-h]\n" " [--translation|-t option]" " [--input-translation|-T option]\n" - " [--verbose|-v] [--backspace|-b]" - " [--timeout-s|-F #] [--timeout-ns|-f #]", + " [--verbose|-v] [--backspace|-b]\n", argv[0]); break; } @@ -972,7 +972,6 @@ main(int argc, char *argv[]) signal(SIGINT, sighandl); signal(SIGQUIT, sighandl); signal(SIGTERM, sighandl); - signal(SIGCHLD, SIG_DFL); fd = openport();