libreoffice-online/net
Ashod Nakashian 01138d7ae0 wsd: save errno before invoking any other functions
Most C and Posix API clobber errno. By failing to save
it immediately after invoking an API we risk simply
reporting the result of an arbitrary subsequent API call.

This adds LOG_SYS_ERRNO to take errno explicitly.
This is necessary because sometimes logging is not done
immediately after calling the function for which we
want to report errno. Similarly, log macros that log
errno need to save errno before calling any functions.
This is necessary as the argements might contain calls
that clobber errno.

This also converts some LOG_SYS entries to LOG_ERR
because there can be no relevant errno in that context
(f.e. in a catch clause).

A couple of LOG_ macros have been folded into others,
reducing redundancy.

Finally, both of these log macros append errno to the
log message, so there is little point in ending the
messages with a period.

Change-Id: Iecc656f67115fec78b65cad4e7c17a17623ecf43
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-29 11:40:17 +00:00
..
Buffer.hpp Fix unit test to not rely on under-defined behavior. 2020-11-29 19:27:23 -05:00
clientnb.cpp fix license headers 2020-10-01 11:56:43 +02:00
DelaySocket.cpp wsd: log: overload chrono duration to simplify logging 2020-12-08 09:26:41 +00:00
DelaySocket.hpp fix license headers 2020-10-01 11:56:43 +02:00
FakeSocket.cpp fix license headers 2020-10-01 11:56:43 +02:00
FakeSocket.hpp Replace all __linux in CPP conditions with __linux__. 2020-11-17 09:21:45 +00:00
HttpHelper.cpp wsd: move HttpHelper namespace from Socket to its home 2020-11-02 07:56:03 -05:00
HttpHelper.hpp wsd: move HttpHelper namespace from Socket to its home 2020-11-02 07:56:03 -05:00
ServerSocket.hpp fix license headers 2020-10-01 11:56:43 +02:00
Socket.cpp wsd: save errno before invoking any other functions 2020-12-29 11:40:17 +00:00
Socket.hpp wsd: save errno before invoking any other functions 2020-12-29 11:40:17 +00:00
Ssl.cpp Implement SslContext::id() for FreeBSD systems by calling pthread_getthreadid_np(). 2020-11-16 14:02:23 +00:00
Ssl.hpp fix license headers 2020-10-01 11:56:43 +02:00
SslSocket.hpp wsd: save errno before invoking any other functions 2020-12-29 11:40:17 +00:00
WebSocketHandler.hpp wsd: test: add Buffer test and minor cosmetics 2020-11-29 19:27:23 -05:00