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
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment