From 2681920f1126ec09a1d77cfeeefe4734f9c965cd Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Sun, 5 Aug 2007 20:16:27 +0300 Subject: [PATCH] Add comment warning about static variable usage in multi threading environments --- fileops/listdir_recursive.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fileops/listdir_recursive.c b/fileops/listdir_recursive.c index acae8ec..6c7ac91 100755 --- a/fileops/listdir_recursive.c +++ b/fileops/listdir_recursive.c @@ -7,6 +7,11 @@ #include #include + +/* Since listdir() uses a static variable to keep track of the call depth, + it is not safe to use it in a multi threading environment. If this is the + case, then you need to pass 'dirdepth' as an argument to listdir(). +*/ int listdir(const char *path) { struct dirent *pdent; -- 2.11.4.GIT