[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: commit: ldap/libraries/liblber io.c

Hallvard B Furuseth wrote:
Howard Chu writes:
But the caller doesn't know that.  What it knows is that
ber_get_next() returned LBER_DEFAULT.
And that's all that matters.

As long as the try-again error code isn't spurious, which is what I don't know when/how can happen. Though hopefully the caller will get another error when it tries again.

It does mean the caller can log the wrong error code though.  In
particular after a non-error return.

What are you talking about, re: spurious error codes? System calls only set errno when they fail. System calls return -1 when they fail. sb_rdahead_read() doesn't set errno either... That's why we have to zero errno out before doing the read, to make sure a stale error code from some previous op isn't hanging around - because read() *won't* touch it when it returns success.

If the caller doesn't see one of the
try-again error codes, then the connection is dropped.

-- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/