[Box Backup-commit] COMMIT r1099 - box/chris/general/lib/common
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Fri, 20 Oct 2006 00:59:24 +0100
Author: chris
Date: 2006-10-20 00:59:24 +0100 (Fri, 20 Oct 2006)
New Revision: 1099
Modified:
box/chris/general/lib/common/EventWatchFilesystemObject.cpp
box/chris/general/lib/common/FileStream.cpp
box/chris/general/lib/common/Guards.h
Log:
Add logging in remaining places where Common OSFileOpenError can be thrown.
Modified: box/chris/general/lib/common/EventWatchFilesystemObject.cpp
===================================================================
--- box/chris/general/lib/common/EventWatchFilesystemObject.cpp 2006-10-19 23:58:58 UTC (rev 1098)
+++ box/chris/general/lib/common/EventWatchFilesystemObject.cpp 2006-10-19 23:59:24 UTC (rev 1099)
@@ -37,6 +37,9 @@
#ifdef HAVE_KQUEUE
if(mDescriptor == -1)
{
+ ::syslog(LOG_ERR, "EventWatchFilesystemObject: "
+ "Failed to open file '%s': %s",
+ Filename, strerror(errno));
THROW_EXCEPTION(CommonException, OSFileOpenError)
}
#else
Modified: box/chris/general/lib/common/FileStream.cpp
===================================================================
--- box/chris/general/lib/common/FileStream.cpp 2006-10-19 23:58:58 UTC (rev 1098)
+++ box/chris/general/lib/common/FileStream.cpp 2006-10-19 23:59:24 UTC (rev 1099)
@@ -63,6 +63,8 @@
#endif
{
MEMLEAKFINDER_NOT_A_LEAK(this);
+ ::syslog(LOG_ERR, "FileStream: called with invalid "
+ "file handle");
THROW_EXCEPTION(CommonException, OSFileOpenError)
}
#ifdef WIN32
@@ -86,6 +88,7 @@
if(mOSFileHandle < 0)
{
MEMLEAKFINDER_NOT_A_LEAK(this);
+ ::syslog(LOG_ERR, "FileStream: copying unopened file");
THROW_EXCEPTION(CommonException, OSFileOpenError)
}
}
Modified: box/chris/general/lib/common/Guards.h
===================================================================
--- box/chris/general/lib/common/Guards.h 2006-10-19 23:58:58 UTC (rev 1098)
+++ box/chris/general/lib/common/Guards.h 2006-10-19 23:59:24 UTC (rev 1099)
@@ -33,6 +33,9 @@
{
if(mOSFileHandle < 0)
{
+ ::syslog(LOG_ERR, "FileHandleGuard: "
+ "failed to open file '%s': error %s",
+ filename, strerror(errno));
THROW_EXCEPTION(CommonException, OSFileOpenError)
}
}