public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: fix one more check for positive virtual_ftype_t values
@ 2019-07-22 20:43 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-07-22 20:43 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ae59d0930803abf0b2228999d4cdff08679b62cd

commit ae59d0930803abf0b2228999d4cdff08679b62cd
Author: Ken Brown <kbrown@cornell.edu>
Date:   Mon Jul 22 14:00:53 2019 -0400

    Cygwin: fix one more check for positive virtual_ftype_t values
    
    Also drop more comments referring to numerical virtual_ftype_t values.

Diff:
---
 winsup/cygwin/fhandler_process.cc  | 3 ---
 winsup/cygwin/fhandler_registry.cc | 4 +---
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 0dafc2f..2a06554 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -86,9 +86,6 @@ static bool get_mem_values (DWORD dwProcessId, size_t &vmsize, size_t &vmrss,
 			    size_t &vmtext, size_t &vmdata, size_t &vmlib,
 			    size_t &vmshare);
 
-/* 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_process::exists ()
 {
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index f7db01b..5fc03fe 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -306,8 +306,6 @@ multi_wcstombs (char *dst, size_t len, const wchar_t *src, size_t nwc)
   return sum;
 }
 
-/* Returns 0 if path doesn't exist, otherwise a virtual_ftype_t value
-   specifying the exact file type. */
 virtual_ftype_t
 fhandler_registry::exists ()
 {
@@ -562,7 +560,7 @@ fhandler_registry::fstat (struct stat *buf)
 		  buf->st_uid = uid;
 		  buf->st_gid = gid;
 		  buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
-		  if (file_type > virt_none)
+		  if (virt_ftype_isdir (file_type))
 		    buf->st_mode |= S_IFDIR;
 		  else
 		    buf->st_mode &= NO_X;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-22 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 20:43 [newlib-cygwin] Cygwin: fix one more check for positive virtual_ftype_t values Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).