Commit 8a3227b2 authored by Petr Baudis's avatar Petr Baudis
Browse files

compctld limitmem: Remove superfluous sanity check

parent 6443fa05
......@@ -247,20 +247,12 @@ sockerror:
size_t minuser, mincomp, maxcomp, total;
memory_limits(&minuser, &mincomp, &maxcomp, &total);
/* Sanity check. */
if (limit < 1024 || limit > total) {
syslog(LOG_WARNING, "limitmem: invalid limit (%zu)", limit);
mprintf(fd, "0 invalid limit value");
close(fd);
continue;
}
if (limit < mincomp) {
mprintf(fd, "-1 at least %zuM must remain available for computations.", mincomp / 1048576);
close(fd);
continue;
}
if (total - limit < minuser) {
if (limit > total || total - limit < minuser) {
mprintf(fd, "-2 at least %zuM must remain available for users.", minuser / 1048576);
close(fd);
continue;
......
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