about summary refs log tree commit diff
path: root/mach/devstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'mach/devstream.c')
-rw-r--r--mach/devstream.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mach/devstream.c b/mach/devstream.c
index db48307856..b54dcff60d 100644
--- a/mach/devstream.c
+++ b/mach/devstream.c
@@ -147,10 +147,16 @@ output (FILE *f, int c)
     {
       kern_return_t err;
       int wrote;
+      int thiswrite;
+
       while (to_write > 0)
 	{
+	  thiswrite = to_write;
+	  if (thiswrite > IO_INBAND_MAX)
+	    thiswrite = IO_INBAND_MAX;
+
 	  if (err = device_write_inband ((device_t) f->__cookie, 0,
-					 f->__target, p, to_write, &wrote))
+					 f->__target, p, thiswrite, &wrote))
 	    {
 	      errno = err;
 	      f->__error = 1;