It would be useful to add an error string pointer to struct tevent_req

Richard Sharpe realrichardsharpe at
Tue Apr 30 13:44:47 MDT 2013

On Tue, Apr 30, 2013 at 11:55 AM, Jeremy Allison <jra at> wrote:
> On Tue, Apr 30, 2013 at 11:33:25AM -0700, Richard Sharpe wrote:
>> Hi folks,
>> Because it can be hard to figure out where, say EINVAL, is coming
>> from, it would be useful to have a pointer to an error string where we
>> can talloc up, in the error path, something that tells you the
>> function and line number an error is coming from.
>> Then when you have several sets of tevents along the way, you get a
>> better idea of why an error has really occurred.
> Do you have a more formal proposal of how we'd do this ?
> We can always reference a talloc'ed string on an 'error'
> context - problem is when to set it (not all code paths
> do or would) vs. just adding a specific debug where you
> suspect it.

I am trying to determine if EINVAL is coming from the writev in static
void tstream_bsd_writev_handler(void *private_data) or from here:

        if (to_write == 0) {
                tevent_req_error(req, EINVAL);
                goto post;

in tstream_writev_send.

At this level, I am not sure we can use DEBUG and friends.

Richard Sharpe

More information about the samba-technical mailing list