diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-03-24 22:54:30 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-03-24 22:54:30 +0000 |
commit | bdb64683f2bb8279c91770869370a0717bb45098 (patch) | |
tree | b85da8dc7a115f3a5c9719a795728349af945e17 /lib | |
parent | 198d823a23f6fbece6a4792c6d7f7f787555ae1e (diff) |
Initialise logging framework and set our program name to Box Backup (bbstored)
(refs #3, merges [1462])
Diffstat (limited to 'lib')
-rw-r--r-- | lib/win32/emu.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp index 0aedffc7..818c6a6b 100644 --- a/lib/win32/emu.cpp +++ b/lib/win32/emu.cpp @@ -1345,13 +1345,17 @@ void openlog(const char * daemonName, int, int) { } - if (!AddEventSource("Box Backup", 0)) + char* name = strdup(daemonName); + BOOL success = AddEventSource(name, 0); + free(name); + + if (!success) { ::syslog(LOG_ERR, "Failed to add our own event source"); return; } - HANDLE newSyslogH = RegisterEventSource(NULL, "Box Backup"); + HANDLE newSyslogH = RegisterEventSource(NULL, daemonName); if (newSyslogH == NULL) { ::syslog(LOG_ERR, "Failed to register our own event source: " |