|
|
return count; | return count; |
} | } |
| |
|
void SMTask::Cleanup() |
|
{ |
|
delete init_task; |
|
} |
|
|
#include <errno.h> | #include <errno.h> |
#include "ResMgr.h" | #include "ResMgr.h" |
ResDecl enospc_fatal ("xfer:disk-full-fatal","no",ResMgr::BoolValidate,ResMgr::NoClosure); | ResDecl enospc_fatal ("xfer:disk-full-fatal","no",ResMgr::BoolValidate,ResMgr::NoClosure); |
|
|
static int TaskCount(); | static int TaskCount(); |
static bool NonFatalError(int err); | static bool NonFatalError(int err); |
static bool TemporaryNetworkError(int err); | static bool TemporaryNetworkError(int err); |
|
|
|
static void Cleanup(); |
}; | }; |
| |
class SMTaskInit : public SMTask | class SMTaskInit : public SMTask |
|
|
Ignore(SIGXFSZ); // and EFBIG | Ignore(SIGXFSZ); // and EFBIG |
#endif | #endif |
} | } |
|
|
|
void SignalHook::Cleanup() |
|
{ |
|
delete [] counts; |
|
delete [] old_handlers; |
|
delete [] old_saved; |
|
} |
|
|
static void RestoreAll(); | static void RestoreAll(); |
| |
static void ClassInit(); | static void ClassInit(); |
|
static void Cleanup(); |
}; | }; |
| |
#endif//SIGNALHOOK_H | #endif//SIGNALHOOK_H |
|
|
#include "xstring.h" | #include "xstring.h" |
#include "log.h" | #include "log.h" |
#include "SMTask.h" | #include "SMTask.h" |
|
#include <iostream> |
|
|
|
using namespace std; |
| |
Log *Log::global=new Log; | Log *Log::global=new Log; |
| |
|
|
Write(l,buf); | Write(l,buf); |
} | } |
| |
|
void Log::Cleanup() |
|
{ |
|
delete global; |
|
} |
Log::~Log() | Log::~Log() |
{ | { |
CloseOutput(); | CloseOutput(); |
|
|
void ShowPID(bool yes=true) { show_pid=yes; } | void ShowPID(bool yes=true) { show_pid=yes; } |
void ShowTime(bool yes=true) { show_time=yes; } | void ShowTime(bool yes=true) { show_time=yes; } |
void ShowContext(bool yes=true) { show_context=yes; } | void ShowContext(bool yes=true) { show_context=yes; } |
|
|
|
static void Cleanup(); |
}; | }; |
| |
#endif // LOG_H | #endif // LOG_H |
|
|
ProcWait::DeleteAll(); | ProcWait::DeleteAll(); |
DirColors::DeleteInstance(); | DirColors::DeleteInstance(); |
IdNameCacheCleanup(); | IdNameCacheCleanup(); |
|
SignalHook::Cleanup(); |
|
Log::Cleanup(); |
|
SMTask::Cleanup(); |
| |
// the tasks left: SMTaskInit, LsCache::ExpireHelper, Log::global. | // the tasks left: SMTaskInit, LsCache::ExpireHelper, Log::global. |
int task_count=SMTask::TaskCount(); | int task_count=SMTask::TaskCount(); |