mirror of
https://github.com/Ascend/ascend-docker-runtime.git
synced 2025-10-11 07:00:17 +08:00
Match-id-6b1150d20beff1efde2654461ec07a0afa9e8a88
This commit is contained in:
@@ -76,7 +76,6 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg)
|
||||
Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES);
|
||||
return false;
|
||||
}
|
||||
errno = 0;
|
||||
args->pid = strtol(optarg, NULL, DECIMAL);
|
||||
const char* pidMax = "/proc/sys/kernel/pid_max";
|
||||
const size_t maxFileSzieMb = 10; // max 10MB
|
||||
@@ -84,6 +83,7 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg)
|
||||
Logger("failed to check pid_max path.", LEVEL_ERROR, SCREEN_YES);
|
||||
return false;
|
||||
}
|
||||
errno = 0;
|
||||
FILE* pFile = NULL;
|
||||
pFile = fopen(pidMax, "r");
|
||||
if ((pFile == NULL) || (fgets(buff, PATH_MAX, pFile) == NULL)) {
|
||||
|
Reference in New Issue
Block a user