Thank you, Charles. We're always happy to get a bug report with analysis and
a solution.
A couple of questions:
1. This doesn't seem unique to the LINK. Should it be used for all serial
writes?
2. Why would the write block?
About the specific code:
Is there a guaranteed exit to the loop?
Also do we need the pause for non EWOULDBLOCK errors?
Paul Alfille
On Sun, Jul 27, 2008 at 3:53 PM, Charles Spirakis <[EMAIL PROTECTED]> wrote:
> + do {
> + LEVEL_DEBUG("erc: %d\n",
> ewouldblock_retry_count++);
> + // Not all versions of gcc/linux touch the
> + // errno on success, so make sure there is no
> + // garbage left in errno from a previous access
> + errno = 0;
> + write_or_error =
> write(pn->selected_connection->file_descriptor, buf,
>
> left_to_write);
> - Debug_Bytes("Link write", buf, left_to_write);
> - //printf("Link write = %d\n",(int)write_or_error);
> + Debug_Bytes("Link write", buf, left_to_write);
> + //printf("Link woe = %d\n",(int)write_or_error);
> + if ((write_or_error < 0) && (EWOULDBLOCK == errno))
> {
> + usleep(1000);
> + }
> + } while (EWOULDBLOCK == errno);
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers