mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-19 07:22:14 +08:00
* pwdgrp.h (pwdgrp::refresh): Fix indentation.
* uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated read. Drop local variable off.
This commit is contained in:
parent
99c7be03b2
commit
e9982f2a2b
@ -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.
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
return;
|
||||
if (pglock.acquire () == 1 &&
|
||||
(!initialized || (check && etc::file_changed (etc_ix))))
|
||||
(this->*read) ();
|
||||
(this->*read) ();
|
||||
pglock.release ();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user