* 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:
@ -1,6 +1,6 @@
|
||||
/* fhandler_virtual.h: Header for virtual fhandlers
|
||||
|
||||
Copyright 2009, 2010, 2011 Red Hat, Inc.
|
||||
Copyright 2009, 2010, 2011, 2014 Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
@ -20,3 +20,26 @@ struct virt_tab_t {
|
||||
|
||||
extern virt_tab_t *virt_tab_search (const char *, bool, const virt_tab_t *,
|
||||
size_t);
|
||||
|
||||
static inline unsigned char
|
||||
virt_ftype_to_dtype (virtual_ftype_t type)
|
||||
{
|
||||
unsigned char d_type;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case virt_directory:
|
||||
d_type = DT_DIR;
|
||||
break;
|
||||
case virt_symlink:
|
||||
d_type = DT_LNK;
|
||||
break;
|
||||
case virt_file:
|
||||
d_type = DT_REG;
|
||||
break;
|
||||
default:
|
||||
d_type = DT_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
return d_type;
|
||||
}
|
||||
|
Reference in New Issue
Block a user