mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
Better PID type conversion
This commit is contained in:
parent
36c7bf4d6f
commit
17b7fb2145
@ -96,7 +96,6 @@ int main(int argc, char** argv)
|
||||
bool blockExternalLinks = false;
|
||||
bool isVerboseFlag = false;
|
||||
bool trustlibrary = true;
|
||||
string PPIDString;
|
||||
unsigned int PPID = 0;
|
||||
|
||||
static struct option long_options[]
|
||||
@ -154,7 +153,6 @@ int main(int argc, char** argv)
|
||||
serverPort = atoi(optarg);
|
||||
break;
|
||||
case 'a':
|
||||
PPIDString = string(optarg);
|
||||
PPID = atoi(optarg);
|
||||
break;
|
||||
case 'i':
|
||||
@ -289,7 +287,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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user