* fhandler_proc.cc (fhandler_proc::readdir): Set dirent d_type.

* fhandler_process.cc (fhandler_process::readdir): Ditto.
	* fhandler_procnet.cc (fhandler_procnet::readdir): Ditto.
	* fhandler_procsys.cc (fhandler_procsys::readdir): Ditto.
	* fhandler_procsysvipc.cc (fhandler_procsysvipc::readdir): Ditto.
	*  fhandler_virtual.h (virt_ftype_to_dtype): Define new inline function
	to generate dirent d_type from virtual_ftype_t.
This commit is contained in:
Corinna Vinschen
2014-10-09 13:24:37 +00:00
parent 633cf9b5dd
commit 54338f169f
7 changed files with 61 additions and 8 deletions

View File

@ -1,6 +1,6 @@
/* fhandler_procnet.cc: fhandler for /proc/net virtual filesystem
Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
This file is part of Cygwin.
@ -115,7 +115,9 @@ fhandler_procnet::readdir (DIR *dir, dirent *de)
if (procnet_tab[dir->__d_position].type == virt_file
&& !get_adapters_addresses (NULL, AF_INET6))
goto out;
strcpy (de->d_name, procnet_tab[dir->__d_position++].name);
strcpy (de->d_name, procnet_tab[dir->__d_position].name);
de->d_type = virt_ftype_to_dtype (procnet_tab[dir->__d_position].type);
dir->__d_position++;
dir->__flags |= dirent_saw_dot | dirent_saw_dot_dot;
res = 0;
out: