Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/comms/aprsd/files/patch-src_utils.cpp
16461 views
1
--- src/utils.cpp.orig 2003-10-01 16:58:27 UTC
2
+++ src/utils.cpp
3
@@ -41,6 +41,7 @@ int CountDefault = 7; //Max of 7 instances of one
4
5
static RecursiveMutex pmtxLog;
6
7
+const string LOGPATH("/var/log/aprsd/");
8
9
int WriteLog(const string& sp, const string& LogFile)
10
{
11
@@ -50,11 +51,12 @@ int WriteLog(const string& sp, const string& LogFile)
12
static Lock locker(pmtxLog, false);
13
14
locker.get();
15
+ string pLogFile = LOGPATH + LogFile;
16
17
- ofstream ofs(LogFile.c_str(), ios::out | ios::app);
18
+ ofstream ofs(pLogFile.c_str(), ios::out | ios::app);
19
20
if (!ofs)
21
- cerr << "File I/O Error: Unable to open/create file " << LogFile << endl;
22
+ cerr << "File I/O Error: Unable to open/create file " << pLogFile << endl;
23
24
time(&ltime); // Timestamp
25
ctime_r(&ltime, szTime); // "threadsafe" ctime
26
@@ -91,8 +93,8 @@ int WriteLog(const char* pch, const char* LogFile)
27
28
pthread_mutex_lock(pmtxLog);
29
30
- char* pLogFile = new char[CONFPATH.length() + strlen(LogFile) +1];
31
- strcpy(pLogFile,CONFPATH.c_str());
32
+ char* pLogFile = new char[LOGPATH.length() + strlen(LogFile) +1];
33
+ strcpy(pLogFile,LOGPATH.c_str());
34
strcat(pLogFile, LogFile);
35
36
f = fopen(pLogFile, "a");
37
38