Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/comms/aprsd/files/patch-src_aprsd.cpp
16461 views
1
--- src/aprsd.cpp.orig 2003-05-29 03:09:39 UTC
2
+++ src/aprsd.cpp
3
@@ -98,7 +98,8 @@ string szAprsPath;
4
int msgsn;
5
6
const string HOMEDIR("/home/aprsd2");
7
-const string CONFPATH("");
8
+const string LOGPATH("/var/log/aprsd/");
9
+const string CONFPATH("/usr/local/etc/aprsd/");
10
const string CONFFILE("aprsd.conf");
11
const string MAINLOG("aprsd.log");
12
const string STSMLOG("thirdparty.log");
13
@@ -126,7 +127,7 @@ void serverQuit(void) /* Invoked by console 'q' q
14
WriteLog(string("Server Shutdown"), MAINLOG);
15
tcsetattr(fileno(stdin),TCSANOW,&initial_settings); //restore terminal mode
16
17
- string outFile = CONFPATH;
18
+ string outFile = LOGPATH;
19
outFile += SAVE_HISTORY;
20
int n = SaveHistory(outFile);
21
22
@@ -872,8 +873,8 @@ int daemonInit(void)
23
if (f.is_open()) {
24
f.read(s, 10);
25
xx = atoi(s);
26
- kill(xx, SIGCHLD); // Meaningless kill to determine if pid is used
27
- if (errno != ESRCH) {
28
+ kill(xx, 0); // Meaningless kill to determine if pid is used
29
+ if (errno == 0) {
30
cout << "aprsd already running" << endl;
31
cout << "PID: " << pid_file << endl;
32
exit(1);
33
@@ -977,7 +978,7 @@ int main(int argc, char *argv[])
34
35
//fdump = fopen("dump.txt","w+"); //debug
36
37
- string histFile = CONFPATH;
38
+ string histFile = LOGPATH;
39
histFile += SAVE_HISTORY;
40
ReadHistory(histFile);
41
42
43