Fix initialization if ENV_NAME_FDS was not set.

If ENV_NAME_FDS is not set then init_from_environment() was called for
each hooked function, instead of just once.
This commit is contained in:
Simon Ruderich
2013-06-01 18:27:56 +02:00
parent 5e162a33ae
commit 7d4d8e0784
2 changed files with 8 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ static size_t tracked_fds_space;
* ENV_NAME_FDS has the following format: Each descriptor as string followed
* by a comma; there's a trailing comma. Example: "2,4,". */
static void init_from_environment(void) {
initialized = 1;
tracked_fds_count = 0;
const char *env = getenv(ENV_NAME_FDS);