(output/write_some): Don't try and write more than IO_INBAND_MAX in a
authordrepper <drepper>
Wed, 19 Mar 1997 05:29:15 +0000 (05:29 +0000)
committerdrepper <drepper>
Wed, 19 Mar 1997 05:29:15 +0000 (05:29 +0000)
single call to device_write_inband.

mach/devstream.c

index db48307..b54dcff 100644 (file)
@@ -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;