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

compctld limitmem: Remove superfluous sanity check

parent 6443fa05
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment