Commit 9fec9099 authored by Jonas Termansen's avatar Jonas Termansen

Indirectly closedir(3) from exit(3).

parent c9e0fa68
......@@ -39,6 +39,7 @@ extern "C" DIR* dnewdir(void)
return NULL;
dir->flags = 0;
dir->free_func = dfreedir;
dir->closedir_indirect = closedir;
dregister(dir);
return dir;
}
......@@ -59,6 +59,7 @@ struct DIR
int (*close_func)(void* user);
void (*free_func)(DIR* dir);
/* Application writers shouldn't use anything beyond this point. */
int (*closedir_indirect)(DIR*);
DIR* prev;
DIR* next;
struct dirent* entry;
......
......@@ -62,7 +62,7 @@ extern "C" void exit(int status)
pthread_mutex_lock(&__first_file_lock);
while ( __first_dir )
closedir(__first_dir);
__first_dir->closedir_indirect(__first_dir);
while ( __first_file )
fclose(__first_file);
......
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