closedir (st);
__closedir (st);
open_dir_stream (struct ftw_data *data, struct dir_data *dirp){  int result = 0;  if (data->dirstreams[data->actdir] != NULL)    {      /* Oh, oh.  We must close this stream.  Get all remaining	 entries and store them as a list in the `content' member of	 the `struct dir_data' variable.  */      size_t bufsize = 1024;      char *buf = malloc (bufsize);      if (buf == NULL)	result = -1;      else	{	  DIR *st = data->dirstreams[data->actdir]->stream;	  struct DIRENT *d;	  size_t actsize = 0;	  while ((d = READDIR (st)) != NULL)	    {	      size_t this_len = _D_EXACT_NAMLEN (d);	      if (actsize + this_len + 2 >= bufsize)		{		  char *newp;		  bufsize += MAX (1024, 2 * this_len);		  newp = realloc (buf, bufsize);		  if (newp == NULL)		    {		      /* No more memory.  */		      int save_err = errno;		      free (buf);		      __set_errno (save_err);		      result = -1;		      break;		    }		  buf = newp;		}	      *((char *) __mempcpy (buf + actsize, d->d_name, this_len))		= '\0';	      actsize += this_len + 1;	    }	  /* Terminate the list with an additional NUL byte.  */	  buf[actsize++] = '\0';	  /* Shrink the buffer to what we actually need.  */	  data->dirstreams[data->actdir]->content = realloc (buf, actsize);	  if (data->dirstreams[data->actdir]->content == NULL)	    {	      int save_err = errno;	      free (buf);	      __set_errno (save_err);	      result = -1;	    }	  else	    {	      closedir (st);	      data->dirstreams[data->actdir]->stream = NULL;	      data->dirstreams[data->actdir] = NULL;	    }	}    }  /* Open the new stream.  */  if (result == 0)    {      assert (data->dirstreams[data->actdir] == NULL);      dirp->stream = opendir (data->dirbuf);      if (dirp->stream == NULL)	result = -1;      else	{	  dirp->content = NULL;	  data->dirstreams[data->actdir] = dirp;	  if (++data->actdir == data->maxdir)	    data->actdir = 0;	}    }  return result;}