Commit ae4449ee authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Add a couple of asserts for Coverity

parent 59dfdbd7
......@@ -56,10 +56,14 @@ struct vsub_priv {
void
VSUB_closefrom(int fd)
{
assert(fd >= 0);
#ifdef HAVE_CLOSEFROM
closefrom(fd);
#else
int i;
int i = sysconf(_SC_OPEN_MAX);
assert(i > 0);
for (i = sysconf(_SC_OPEN_MAX); i > fd; i--)
(void)close(i);
#endif
......
Markdown is supported
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