good for merge into trunk
regards
-steve
On Thu, 2009-08-13 at 17:33 +0200, Jérôme Flesch wrote:
> Hello,
>
> On BSD systems, if recv() returns 0, it means the remote process
> disconnected, and so coroipcc_dispatch_get() must return CS_ERR_LIBRARY.
>
> On any systems, if recv() return -1 and errno == EINTR, I assume
> coroipcc_dispatch_get() must return CS_ERR_TRY_AGAIN. However, because
> the value was set in 'res' instead of 'error', CS_OK is returned instead.
> plain text document attachment
> (fix-coroipcc_dispatch_get-ret-val.patch)
> diff --git a/lib/coroipcc.c b/lib/coroipcc.c
> index 31de656..27a8b69 100644
> --- a/lib/coroipcc.c
> +++ b/lib/coroipcc.c
> @@ -827,13 +827,16 @@ coroipcc_dispatch_get (
>
> res = recv (ipc_instance->fd, &buf, 1, 0);
> if (res == -1 && errno == EINTR) {
> - res = CS_ERR_TRY_AGAIN;
> + error = CS_ERR_TRY_AGAIN;
> goto error_put;
> } else
> if (res == -1) {
> goto error_put;
> }
> if (res == 0) {
> +#if defined(COROSYNC_BSD) || defined(COROSYNC_DARWIN)
> + error = CS_ERR_LIBRARY;
> +#endif
> goto error_put;
> }
> ipc_instance->flow_control_state = 0;
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/openais
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais