Cygwin: change virtual_ftype_t to not rely on negative values

So far negative values were denoting files, positive values
denoting directories.  We should prefer a less error prone
method.  Redefine virtual_ftype_t to contain only positive
values and replace checks for negativ or positive values with
inline functions virt_ftype_isfile() and virt_ftype_isdir().

Drop outdcated comments referring to numerical virtual_ftype_t
values.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-07-22 18:40:33 +02:00
parent e118a605e2
commit dec444bee3
9 changed files with 31 additions and 36 deletions

View File

@ -41,10 +41,6 @@ static const virt_tab_t procnet_tab[] =
static const int PROCNET_LINK_COUNT =
(sizeof (procnet_tab) / sizeof (virt_tab_t)) - 1;
/* Returns 0 if path doesn't exist, >0 if path is a directory,
* -1 if path is a file, -2 if path is a symlink, -3 if path is a pipe,
* -4 if path is a socket.
*/
virtual_ftype_t
fhandler_procnet::exists ()
{