mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 03:52:35 -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 blockExternalLinks = false;
|
||||||
bool isVerboseFlag = false;
|
bool isVerboseFlag = false;
|
||||||
bool trustlibrary = true;
|
bool trustlibrary = true;
|
||||||
string PPIDString;
|
|
||||||
unsigned int PPID = 0;
|
unsigned int PPID = 0;
|
||||||
|
|
||||||
static struct option long_options[]
|
static struct option long_options[]
|
||||||
@ -154,7 +153,6 @@ int main(int argc, char** argv)
|
|||||||
serverPort = atoi(optarg);
|
serverPort = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a':
|
||||||
PPIDString = string(optarg);
|
|
||||||
PPID = atoi(optarg);
|
PPID = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
@ -289,7 +287,7 @@ int main(int argc, char** argv)
|
|||||||
int ret = sysctl(mib, MIBSIZE, &kp, &len, NULL, 0);
|
int ret = sysctl(mib, MIBSIZE, &kp, &len, NULL, 0);
|
||||||
if (ret != -1 && len > 0) {
|
if (ret != -1 && len > 0) {
|
||||||
#else /* Linux & co */
|
#else /* Linux & co */
|
||||||
string procPath = "/proc/" + string(PPIDString);
|
string procPath = "/proc/" + std::to_string(PPID);
|
||||||
if (access(procPath.c_str(), F_OK) != -1) {
|
if (access(procPath.c_str(), F_OK) != -1) {
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user