diff options
author | ache <ache@FreeBSD.org> | 2000-04-27 21:31:23 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2000-04-27 21:31:23 +0000 |
commit | ecbfef142fe07cfdc2340f8798a40ccb16381424 (patch) | |
tree | e87a6bf52c0c5afbf5c65e7dbc73291d1ab484b0 /bin/stty/stty.c | |
parent | 676117ef4cc0044d29cace8f438915a5fdc4de45 (diff) | |
download | FreeBSD-src-ecbfef142fe07cfdc2340f8798a40ccb16381424.zip FreeBSD-src-ecbfef142fe07cfdc2340f8798a40ccb16381424.tar.gz |
Add ability to manipulate with drain wait time
Diffstat (limited to 'bin/stty/stty.c')
-rw-r--r-- | bin/stty/stty.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/stty/stty.c b/bin/stty/stty.c index 3b59131..b9f0811 100644 --- a/bin/stty/stty.c +++ b/bin/stty/stty.c @@ -103,6 +103,8 @@ args: argc -= optind; err(1, "TIOCGETD"); if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0) warn("TIOCGWINSZ: %s\n", strerror(errno)); + if (ioctl(i.fd, TIOCGDRAINWAIT, &i.timeout) < 0) + warn("TIOCGDRAINWAIT: %s\n", strerror(errno)); checkredirect(); /* conversion aid */ @@ -113,14 +115,14 @@ args: argc -= optind; /* FALLTHROUGH */ case BSD: case POSIX: - print(&i.t, &i.win, i.ldisc, fmt); + print(&i.t, &i.win, i.ldisc, i.timeout, fmt); break; case GFLAG: - gprint(&i.t, &i.win, i.ldisc); + gprint(&i.t, &i.win, i.ldisc, i.timeout); break; } - for (i.set = i.wset = 0; *argv; ++argv) { + for (i.set = i.wset = i.tset = 0; *argv; ++argv) { if (ksearch(&argv, &i)) continue; @@ -141,8 +143,9 @@ args: argc -= optind; } if (!strncmp(*argv, "gfmt1", sizeof("gfmt1") - 1)) { - gread(&i.t, *argv + sizeof("gfmt1") - 1); + gread(&i.t, &i.timeout, *argv + sizeof("gfmt1") - 1); i.set = 1; + i.tset = 1; continue; } @@ -154,6 +157,8 @@ args: argc -= optind; err(1, "tcsetattr"); if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0) warn("TIOCSWINSZ"); + if (i.tset && ioctl(i.fd, TIOCSDRAINWAIT, &i.timeout) < 0) + warn("TIOCSDRAINWAIT"); exit(0); } |