]> sourceware.org Git - newlib-cygwin.git/commitdiff
* pwdgrp.h (pwdgrp::refresh): Fix indentation.
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 20 Dec 2008 09:35:18 +0000 (09:35 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 20 Dec 2008 09:35:18 +0000 (09:35 +0000)
* uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated
read.  Drop local variable off.

winsup/cygwin/ChangeLog
winsup/cygwin/pwdgrp.h
winsup/cygwin/uinfo.cc

index f9aec8bade7fd2befa8fd2b97eca4642a3512fcd..276b12057ed05cc086470eac6f5ad8fb7372f910 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-20  Corinna Vinschen  <corinna@vinschen.de>
+
+       * pwdgrp.h (pwdgrp::refresh): Fix indentation.
+       * uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated
+       read.  Drop local variable off.
+
 2008-12-19  Christopher Faylor  <me+cygwin@cgf.cx>
 
        * pinfo.cc (pinfo_basic): New class.
index 7db722c12b1279de022697d611b255e3338cc2ab..00ef2e87ac65a4c553d71f995ef0a8726af6eca9 100644 (file)
@@ -75,7 +75,7 @@ public:
       return;
     if (pglock.acquire () == 1 &&
        (!initialized || (check && etc::file_changed (etc_ix))))
-       (this->*read) ();
+      (this->*read) ();
     pglock.release ();
   }
 
index f9ed1a6863f7e9e71fc0f3ec4963f7a112ac2f83..9b6733f2290f27ab761fcfe838d1ff493277f9d7 100644 (file)
@@ -516,7 +516,6 @@ pwdgrp::load (const wchar_t *rel_path)
   static const char succeeded[] = "succeeded";
   const char *res = failed;
   HANDLE fh = NULL;
-  LARGE_INTEGER off = { QuadPart:0LL };
 
   NTSTATUS status;
   OBJECT_ATTRIBUTES attr;
@@ -543,8 +542,8 @@ pwdgrp::load (const wchar_t *rel_path)
 
   paranoid_printf ("%S", &upath);
 
-  status = NtOpenFile (&fh, FILE_READ_DATA, &attr, &io,
-                      FILE_SHARE_VALID_FLAGS, 0);
+  status = NtOpenFile (&fh, SYNCHRONIZE | FILE_READ_DATA, &attr, &io,
+                      FILE_SHARE_VALID_FLAGS, FILE_SYNCHRONOUS_IO_NONALERT);
   if (!NT_SUCCESS (status))
     {
       paranoid_printf ("NtOpenFile(%S) failed, status %p", &upath, status);
@@ -568,8 +567,8 @@ pwdgrp::load (const wchar_t *rel_path)
       paranoid_printf ("malloc (%d) failed", fsi.EndOfFile.LowPart);
       goto out;
     }
-  status = NtReadFile (fh, NULL, NULL, NULL, &io, buf,
-                      fsi.EndOfFile.LowPart, &off, NULL);
+  status = NtReadFile (fh, NULL, NULL, NULL, &io, buf, fsi.EndOfFile.LowPart,
+                      NULL, NULL);
   if (!NT_SUCCESS (status))
     {
       paranoid_printf ("NtReadFile(%S) failed, status %p", &upath, status);
This page took 0.03711 seconds and 5 git commands to generate.