OSDN Git Service

* pwdgrp.h (pwdgrp_read::open): Compare fh to INVALID_HANDLE_VALUE.
authorcgf <cgf>
Thu, 24 Oct 2002 14:33:13 +0000 (14:33 +0000)
committercgf <cgf>
Thu, 24 Oct 2002 14:33:13 +0000 (14:33 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/pwdgrp.h

index c5ab98a..8983a8e 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-24  Pierre Humblet <pierre.humblet@ieee.org>
+  
+       * pwdgrp.h (pwdgrp_read::open): Compare fh to INVALID_HANDLE_VALUE.
+
 2002-10-22  Christopher Faylor  <cgf@redhat.com>
 
        * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind.
        * shared.cc (open_shared): Remove reserving of memory since previous
        change eliminate the need for this hack.
 
-
 2002-10-19  Christopher Faylor  <cgf@redhat.com>
 
        * fork.cc (fork_child): Move pinfo fixup later to attempt some minor
index 530adf6..75de89f 100644 (file)
@@ -71,7 +71,7 @@ public:
 
     fh = CreateFile (pc, GENERIC_READ, wincap.shared (), NULL, OPEN_EXISTING,
                     FILE_ATTRIBUTE_NORMAL, 0);
-    if (fh)
+    if (fh != INVALID_HANDLE_VALUE)
       {
        DWORD size = GetFileSize (fh, NULL), read_bytes;
        buf = (char *) malloc (size + 1);
@@ -84,7 +84,7 @@ public:
            fh = NULL;
            return false;
          }
-        buf[read_bytes] = '\0';
+       buf[read_bytes] = '\0';
        return true;
       }
     return false;