Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tcf-dev] set_error_report_errno()

Hi,

While developing a symbol service, I see calls to set_error_report_errno().

This function claims to set and return errno from the given report.

But from what I can see in the code, errno is always set to zero and always returns zero.

 

If this is correct, then I must have misread something, please inform me.

But if it is a bug, I guess that fixing it (setting and returning non-zero errno) would have

consequences since set_error_report_errno() seems to be heavily used.

 

Best regards,

Claes

 

errors.h:

/*

* Set errno to indicate TCF standard error report.

* Report objects are kept in a queue of limited size, and old reports are

* disposed by calling release_error_report().

* Clients should not rely on reports being kept in the queue longer then one dispatch cycle.

* Persistent error report can be obtained by calling get_error_report().

* Return new value of errno.

*/

extern int set_error_report_errno(ErrorReport * report);

 

errors.c:

int set_error_report_errno(ErrorReport * r) {

    errno = 0;

    if (r != NULL) {

        ReportBuffer * report = (ReportBuffer *)((char *)r - offsetof(ReportBuffer, pub));

        ErrorMessage * m = alloc_msg(SRC_REPORT);

        m->error = report->pub.code + STD_ERR_BASE;

        m->report = report;

        report->refs++;

    }

    return errno;

}

 

----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


Back to the top