On Mon, Nov 3, 2008 at 11:57 AM, Enlightenment SVN
<[EMAIL PROTECTED]> wrote:
> +   /* first write the len into the pipe */
> +   do
> +     {
> +       ret = pipe_write(p->fd_write, &nbytes, sizeof(nbytes));
> +       if (ret == sizeof(nbytes))
> +         {
> +            retry = ECORE_PIPE_WRITE_RETRY;
> +            break;
> +         }
> +       else if (ret > 0)
> +         {
> +            /* XXX What should we do here? */
> +            fprintf(stderr, "The length of the data was not written complete"
> +                 " to the pipe\n");

try to read what's missing, you'll end with EAGAIN if there is no data
yet. In that case you either try a busy loop or you save number of
read bytes and what's missing and continue on next next fd_handler.

> +       else
> +         {
> +            fprintf(stderr, "An unhandled error (ret: %d errno: %d)"
> +                  "occured while writing to the pipe the length\n",
> +                  ret, errno);

please, use strerror(errno) to make it easier to figure out what's happened.


> +         }
> +     }
> +   while (retry--);
> +
> +   if (retry != ECORE_PIPE_WRITE_RETRY)
> +     return 0;

this termination condition is weird, if it's "retry" it should mean we
should retry, not that it finished fine.

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [EMAIL PROTECTED]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

-------------------------------------------------------------------------
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=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to