diff options
author | Reinhard Tartler <siretart@tauware.de> | 2008-01-19 15:08:54 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2008-01-19 15:08:54 +0100 |
commit | 2733267954e91e394fbb512ea3abb4c497c0752f (patch) | |
tree | d6cdebd8776bceba06a2fb5e4ed06a4744bc1b57 /lib/common/Utils.cpp | |
parent | 1d56581c644c53f1b9a182c6574bc2fc5243d4d1 (diff) |
import version 0.11rc1
This commit has been made by 'bzr import'. I used the upstream tarball
of Version 0.11rc1 for creating it. It has the md5sum:
75608d8bb72dff9a556850ccd0ae8cb9
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) { |