[Mono-dev] [Mono-patches] r150061 - trunk/mono/support

Rodrigo Kumpera kumpera at gmail.com
Wed Jan 27 09:01:29 EST 2010


Hi Leszek,

This patch breaks OSX as it doesn't define B460800. Is guarding the case
entry if a "#if defined (B460800)" the right way to fix it?

Thanks,
Rodrigo

On Fri, Jan 22, 2010 at 8:30 AM, Leszek Ciesielski (skolima at gmail.com) <
mono-patches-list at lists.ximian.com> wrote:

> Author: leszek
> Date: 2010-01-22 05:30:08 -0500 (Fri, 22 Jan 2010)
> New Revision: 150061
>
> Modified:
>   trunk/mono/support/ChangeLog
>   trunk/mono/support/serial.c
> Log:
> 2010-01-22 Leszek Ciesielski <skolima at gmail.com>
>
>        * serial.c: baud rate 460800 by Thad Thompson <
> TThompson at nucsafe.com>
>        * serial.c: report errors from every function
>
>
> Modified: trunk/mono/support/ChangeLog
> ===================================================================
> --- trunk/mono/support/ChangeLog        2010-01-22 09:49:07 UTC (rev
> 150060)
> +++ trunk/mono/support/ChangeLog        2010-01-22 10:30:08 UTC (rev
> 150061)
> @@ -1,3 +1,8 @@
> +2010-01-22 Leszek Ciesielski <skolima at gmail.com>
> +
> +       * serial.c: baud rate 460800 by Thad Thompson <
> TThompson at nucsafe.com>
> +       * serial.c: report errors from every function
> +
>  2009-12-16 Gonzalo Paniagua Javier <gonzalo at novell.com>
>
>        * zlib-helper.c: when finishing uncompressing a buffer, we might
> need
>
> Modified: trunk/mono/support/serial.c
> ===================================================================
> --- trunk/mono/support/serial.c 2010-01-22 09:49:07 UTC (rev 150060)
> +++ trunk/mono/support/serial.c 2010-01-22 10:30:08 UTC (rev 150061)
> @@ -66,9 +66,6 @@
>        int fd;
>        fd = open (devfile, O_RDWR | O_NOCTTY | O_NONBLOCK);
>
> -       if (fd == -1)
> -               return -1;
> -
>        return fd;
>  }
>
> @@ -128,10 +125,10 @@
>        return 0;
>  }
>
> -void
> +int
>  discard_buffer (int fd, gboolean input)
>  {
> -       tcflush(fd, input ? TCIFLUSH : TCOFLUSH);
> +       return tcflush(fd, input ? TCIFLUSH : TCOFLUSH);
>  }
>
>  gint32
> @@ -151,7 +148,9 @@
>  {
>        struct termios newtio;
>
> -       tcgetattr (fd, &newtio);
> +       if (tcgetattr (fd, &newtio) == -1)
> +               return FALSE;
> +
>        newtio.c_cflag |=  (CLOCAL | CREAD);
>        newtio.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL | ISIG |
> IEXTEN );
>        newtio.c_oflag &= ~(OPOST);
> @@ -160,6 +159,9 @@
>        /* setup baudrate */
>        switch (baud_rate)
>        {
> +       case 460800:
> +           baud_rate = B460800;
> +           break;
>        case 230400:
>            baud_rate = B230400;
>            break;
> @@ -398,10 +400,10 @@
>        return 1;
>  }
>
> -void
> +int
>  breakprop (int fd)
>  {
> -       tcsendbreak (fd, 0);
> +       return tcsendbreak (fd, 0);
>  }
>
>  gboolean
>
> _______________________________________________
> Mono-patches maillist  -  Mono-patches at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-patches
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100127/166b5e5b/attachment.html 


More information about the Mono-devel-list mailing list