diff options
Diffstat (limited to 'lib/common/Utils.cpp')
-rw-r--r-- | lib/common/Utils.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index 7a7e59d1..def6e9b7 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -1,4 +1,4 @@ -// distribution boxbackup-0.10 (svn version: 494) +// distribution boxbackup-0.11rc1 (svn version: 2023_2024) // // Copyright (c) 2003 - 2006 // Ben Summers and contributors. All rights reserved. @@ -58,6 +58,7 @@ #include "Utils.h" #include "CommonException.h" +#include "Logging.h" #include "MemLeakFindOn.h" @@ -109,14 +110,16 @@ void DumpStackBacktrace() size = backtrace (array, 10); strings = backtrace_symbols (array, size); - printf ("Obtained %zd stack frames.\n", size); + BOX_TRACE("Obtained " << size << " stack frames."); for(i = 0; i < size; i++) - printf("%s\n", strings[i]); + { + BOX_TRACE(strings[i]); + } -#ifndef MEMLEAKFINDER_MALLOC_MONITORING_DEFINED +#include "MemLeakFindOff.h" free (strings); -#endif +#include "MemLeakFindOn.h" } #endif @@ -133,7 +136,7 @@ void DumpStackBacktrace() bool FileExists(const char *Filename, int64_t *pFileSize, bool TreatLinksAsNotExisting) { struct stat st; - if(::stat(Filename, &st) != 0) + if(::lstat(Filename, &st) != 0) { if(errno == ENOENT) { @@ -170,15 +173,15 @@ bool FileExists(const char *Filename, int64_t *pFileSize, bool TreatLinksAsNotEx // -------------------------------------------------------------------------- // // Function -// Name: ObjectExists(const char *) +// Name: ObjectExists(const std::string& rFilename) // Purpose: Does a object exist, and if so, is it a file or a directory? // Created: 23/11/03 // // -------------------------------------------------------------------------- -int ObjectExists(const char *Filename) +int ObjectExists(const std::string& rFilename) { struct stat st; - if(::stat(Filename, &st) != 0) + if(::stat(rFilename.c_str(), &st) != 0) { if(errno == ENOENT) { |