diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-04-03 19:35:53 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-04-04 13:34:47 +0200 |
commit | 96ae6bc47414194a477bf95a1f5a360b555884b3 (patch) | |
tree | 3f59ea544ecdff70c02a4b8ba7468ae5598f476c /sal/osl/unx/uunxapi.hxx | |
parent | 6a956b68aed8b61dc312c0618b9624c19963526e (diff) |
Show what pathname a fd was opened from in the SAL_INFO("sal.file") calls
The pathname is logged in abbreviated form.
This, like the two preceding commits, is not claimed to be perfect,
MT-safe, etc. It is for debugging output, for SAL_LOG=+INFO.sal.file.
If you don't like it, don't use it. Or improve it. Or revert it, I
promise not to bother again. Just don't start bike-shedding.
Change-Id: Ie8fcea5f5f2373671eebf9ee54d32143e7ed68e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91679
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sal/osl/unx/uunxapi.hxx')
-rw-r--r-- | sal/osl/unx/uunxapi.hxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sal/osl/unx/uunxapi.hxx b/sal/osl/unx/uunxapi.hxx index 867443b45746..1c7a022a7c9a 100644 --- a/sal/osl/unx/uunxapi.hxx +++ b/sal/osl/unx/uunxapi.hxx @@ -28,6 +28,7 @@ #include <rtl/ustring.h> #include <rtl/ustring.hxx> +#include <sal/log.hxx> int stat_c(const char *cpPath, struct stat* buf); @@ -74,6 +75,7 @@ namespace osl int mkdir(const OString& aPath, mode_t aMode); + // The following are for debugging output only, don't bother getting upset about performance etc. inline OString openFlagsToString(int flags) { OString result; @@ -194,6 +196,34 @@ namespace osl return result; } +#if defined SAL_LOG_INFO + void registerPathForFd(int fd, const char *path); + + void unregisterPathForFd(int fd); + + OUString fdAndPath(int fd); + + void dumpFdToPathMap(); +#else + inline void registerPathForFd(int, const char *) + { + } + + inline void unregisterPathForFd(int) + { + } + + inline OUString fdAndPath(int) + { + return ""; + } + + inline void dumpFdToPathMap() + { + } +#endif + + } // end namespace osl #endif // INCLUDED_SAL_OSL_UNX_UUNXAPI_HXX |