summaryrefslogtreecommitdiffstats
path: root/usr.bin/mg/ttyio.c
diff options
context:
space:
mode:
authorlum <lum@openbsd.org>2021-03-20 09:00:49 +0000
committerlum <lum@openbsd.org>2021-03-20 09:00:49 +0000
commitc65492eb769f60fbd74bdb04ac96ba44d33263df (patch)
tree54f966c12861f12d2a22438d061cfda6ea0564a0 /usr.bin/mg/ttyio.c
parentAdd new test-tls13-multiple-ccs-messages.py (diff)
downloadwireguard-openbsd-c65492eb769f60fbd74bdb04ac96ba44d33263df.tar.xz
wireguard-openbsd-c65492eb769f60fbd74bdb04ac96ba44d33263df.zip
Add a 'batch' mode to mg via the '-b' command line option which will
initialise a pty, run the specified file of mg commands and then exit. This is to facilitate mg fitting into the OpenBSD regress test framework and be able to run via a cron job.
Diffstat (limited to '')
-rw-r--r--usr.bin/mg/ttyio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mg/ttyio.c b/usr.bin/mg/ttyio.c
index 57c03e40f0f..54ddd8efe15 100644
--- a/usr.bin/mg/ttyio.c
+++ b/usr.bin/mg/ttyio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttyio.c,v 1.39 2021/03/01 10:51:14 lum Exp $ */
+/* $OpenBSD: ttyio.c,v 1.40 2021/03/20 09:00:49 lum Exp $ */
/* This file is in the public domain. */
@@ -140,7 +140,7 @@ ttflush(void)
ssize_t written;
char *buf = obuf;
- if (nobuf == 0)
+ if (nobuf == 0 || batch == 1)
return;
while ((written = write(fileno(stdout), buf, nobuf)) != nobuf) {