bugfix: resend: fix serial_flush

Alexandre Julliard julliard at winehq.org
Mon Dec 22 07:21:53 CST 2008


Wolfgang Walter <wine at stwm.de> writes:

> @@ -201,7 +202,17 @@ static void serial_flush( struct fd *fd, struct event **event )
>      /* MSDN says: If hFile is a handle to a communications device,
>       * the function only flushes the transmit buffer.
>       */
> -    if (tcflush( get_unix_fd(fd), TCOFLUSH ) == -1) file_set_error();
> +    /* FlushFileBuffers does NOT have the semantics of tcflush.
> +     * Whereas tcflush discards any data not yet transmitted
> +     * FlushFileBuffers ensures they are written out.
> +     * The POSIX equivalent is tcdrain
> +     */
> +    while (tcdrain( get_unix_fd(fd)) == -1) {
> +    	if (errno != EINTR) {
> +            file_set_error();
> +            return;
> +        }

This will block, you can't do that in the server.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list