main: don't close all file descriptors on startup
Removed closeAllFDs(). The caller is responsible for closing all file handles.
This commit is contained in:
parent
5d6e96e986
commit
06f9b6c379
11
src/main.c
11
src/main.c
@ -224,15 +224,6 @@ static void parseOptions(int argc, char **argv, Options * options)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void closeAllFDs(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int fds = getdtablesize();
|
|
||||||
|
|
||||||
for (i = 3; i < fds; i++)
|
|
||||||
close(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void changeToUser(void)
|
static void changeToUser(void)
|
||||||
{
|
{
|
||||||
ConfigParam *param = getConfigParam(CONF_USER);
|
ConfigParam *param = getConfigParam(CONF_USER);
|
||||||
@ -391,8 +382,6 @@ int main(int argc, char *argv[])
|
|||||||
Options options;
|
Options options;
|
||||||
clock_t start;
|
clock_t start;
|
||||||
|
|
||||||
closeAllFDs();
|
|
||||||
|
|
||||||
initConf();
|
initConf();
|
||||||
|
|
||||||
parseOptions(argc, argv, &options);
|
parseOptions(argc, argv, &options);
|
||||||
|
Loading…
Reference in New Issue
Block a user