user readdir_r() instead of readdir()
bugfix: if there is no listeners list , there is no point in trying iterating over it