Skip to content
Snippets Groups Projects
Commit 300a18fc authored by Petr Baudis's avatar Petr Baudis
Browse files

compctl limit_mem(): Print an explanation in case of 0-class error

parent 490caf5d
No related branches found
No related tags found
No related merge requests found
......@@ -160,8 +160,12 @@ limit_mem(size_t limit)
snprintf(cmd, sizeof(cmd), "limitmem %zu", limit * 1048576);
char *line = daemon_chat(cmd);
if (line[0] != '1') {
/* TODO: Error message postprocessing. */
/* TODO: More error message postprocessing. */
fprintf(stderr, "%s\n", *line ? line : "unexpected hangup");
if (line[0] == '0') {
fprintf(stderr, "Most likely, the computations are already using too much memory.\n"
"Consider stopping some of them first.\n");
}
exit(EXIT_FAILURE);
}
free(line);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment