Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Mareš
compctl-kam
Commits
8a3227b2
Commit
8a3227b2
authored
Mar 07, 2012
by
Petr Baudis
Browse files
compctld limitmem: Remove superfluous sanity check
parent
6443fa05
Changes
1
Hide whitespace changes
Inline
Side-by-side
compctld.c
View file @
8a3227b2
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment