mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
parent
3ed414db81
commit
fa4161853d
@ -119,9 +119,10 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char line[2048];
|
const int linesize = 128 * 1024;
|
||||||
|
char *line = new char[linesize];
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), fp) != NULL) {
|
while (fgets(line, linesize, fp) != NULL) {
|
||||||
// remove trailing new-line
|
// remove trailing new-line
|
||||||
while (strlen(line) > 0 &&
|
while (strlen(line) > 0 &&
|
||||||
(line[strlen(line) - 1] == '\r' || line[strlen(line) - 1] == '\n'))
|
(line[strlen(line) - 1] == '\r' || line[strlen(line) - 1] == '\n'))
|
||||||
@ -140,6 +141,7 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete line;
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user