|
|
|
@ -983,7 +983,6 @@ int main(int argc, char** argv)
|
|
|
|
|
int serverPort = 80;
|
|
|
|
|
int daemonFlag [[gnu::unused]] = false;
|
|
|
|
|
int libraryFlag = false;
|
|
|
|
|
string PPIDString;
|
|
|
|
|
unsigned int PPID = 0;
|
|
|
|
|
|
|
|
|
|
static struct option long_options[]
|
|
|
|
@ -1030,7 +1029,6 @@ int main(int argc, char** argv)
|
|
|
|
|
serverPort = atoi(optarg);
|
|
|
|
|
break;
|
|
|
|
|
case 'a':
|
|
|
|
|
PPIDString = string(optarg);
|
|
|
|
|
PPID = atoi(optarg);
|
|
|
|
|
break;
|
|
|
|
|
case 'f':
|
|
|
|
@ -1358,7 +1356,7 @@ int main(int argc, char** argv)
|
|
|
|
|
int ret = sysctl(mib, MIBSIZE, &kp, &len, NULL, 0);
|
|
|
|
|
if (ret != -1 && len > 0) {
|
|
|
|
|
#else /* Linux & co */
|
|
|
|
|
string procPath = "/proc/" + string(PPIDString);
|
|
|
|
|
string procPath = "/proc/" + std::to_string(PPID);
|
|
|
|
|
if (access(procPath.c_str(), F_OK) != -1) {
|
|
|
|
|
#endif
|
|
|
|
|
} else {
|
|
|
|
|