[OPEN-ILS-DEV] PATCH: socket_bundle.c (adding strerror())
Scott McKellar
mck9 at swbell.net
Thu May 31 00:10:14 EDT 2007
This is a moderately large patch, but it's mostly repetitious and
stereotyped. It uses strerror() to add more meaningful information
to various error messages about socket calls.
Rationale: more detailed information about error conditions will
make it easier to diagnose problems. Otherwise you have to guess.
Warning #1: I have no intention of trying to test all of these
additions, although I did test one of them. Since the extra code
is so simplistic, setting up a test for every message would be far
more trouble than it would be worth, in my opinion. Your opinion
may differ.
Warning #2: These changes were tedious to code, and tedium sometimes
leads to carelessness. Please eyeball and doublecheck them before
applying them.
Warning #3: strerror() is not thread safe, because it returns a
pointer to an internal buffer. I don't know if thread safety is of
any concern, or ever will be. If so, I can replace sterror() with
strerror_r(), which is reentrant and therefore thread safe. It
merely involves more tedium, because the calling code has to provide
a buffer to receive the message.
Warning #4. Bill Erickson has posted a note that he is rearranging
the error handling in _socket_handle_client_data(). The code from
which I built this patch does not include Bill's changes, so whoever
applies this patch (if anyone does) will need to tiptoe around this
area.
Scott McKellar
http://home.swbell.net/mck9/aargh/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socket_bundle_c_1.patch
Type: text/x-patch
Size: 15437 bytes
Desc: 149164323-socket_bundle_c_1.patch
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20070530/fade26fb/socket_bundle_c_1.bin
More information about the Open-ils-dev
mailing list