From: corinna Date: Sat, 20 Dec 2008 09:35:18 +0000 (+0000) Subject: * pwdgrp.h (pwdgrp::refresh): Fix indentation. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9e834ef1c521a2713e39b77f4fbbb952231fe745;p=pf3gnuchains%2Fpf3gnuchains3x.git * pwdgrp.h (pwdgrp::refresh): Fix indentation. * uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated read. Drop local variable off. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f9aec8bade..276b12057e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2008-12-20 Corinna Vinschen + + * 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 * pinfo.cc (pinfo_basic): New class. diff --git a/winsup/cygwin/pwdgrp.h b/winsup/cygwin/pwdgrp.h index 7db722c12b..00ef2e87ac 100644 --- a/winsup/cygwin/pwdgrp.h +++ b/winsup/cygwin/pwdgrp.h @@ -75,7 +75,7 @@ public: return; if (pglock.acquire () == 1 && (!initialized || (check && etc::file_changed (etc_ix)))) - (this->*read) (); + (this->*read) (); pglock.release (); } diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index f9ed1a6863..9b6733f229 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -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);