summaryrefslogtreecommitdiff
path: root/sal/osl/unx/uunxapi.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sal/osl/unx/uunxapi.cxx')
-rw-r--r--sal/osl/unx/uunxapi.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index a6dd0954bf41..3d8fb144a255 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -24,6 +24,7 @@
#include <limits.h>
#include <rtl/ustring.hxx>
#include <osl/thread.h>
+#include <sal/log.hxx>
#ifdef ANDROID
#include <osl/detail/android-bootstrap.h>
@@ -288,6 +289,13 @@ int open_c(const char *cpPath, int oflag, int mode)
accessFilePathState *state = prepare_to_access_file_path(cpPath);
int result = open(cpPath, oflag, mode);
+ int saved_errno = errno;
+ if (result == -1)
+ {
+ SAL_INFO("sal.file", "open(" << cpPath << ",0" << std::oct << oflag << ",0" << mode << std::dec << "): errno " << saved_errno << ": " << strerror(saved_errno));
+ }
+ else
+ SAL_INFO("sal.file", "open(" << cpPath << ",0" << std::oct << oflag << ",0" << mode << std::dec << ") => " << result);
#if HAVE_FEATURE_MACOSX_SANDBOX
if (isSandboxed && result != -1 && (oflag & O_CREAT) && (oflag & O_EXCL))
@@ -318,6 +326,8 @@ int open_c(const char *cpPath, int oflag, int mode)
done_accessing_file_path(cpPath, state);
+ errno = saved_errno;
+
return result;
}
@@ -353,6 +363,14 @@ int ftruncate_with_name(int fd, sal_uInt64 uSize, rtl_String* path)
int result = ftruncate(fd, uSize);
+ if (result < 0)
+ {
+ int e = errno;
+ SAL_INFO("sal.file", "ftruncate(" << fd << "," << uSize << "): errno " << e << ": " << strerror(e));
+ }
+ else
+ SAL_INFO("sal.file", "ftruncate(" << fd << "," << uSize << "): OK");
+
done_accessing_file_path(fn.getStr(), state);
return result;