+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.
static const char succeeded[] = "succeeded";
const char *res = failed;
HANDLE fh = NULL;
- LARGE_INTEGER off = { QuadPart:0LL };
NTSTATUS status;
OBJECT_ATTRIBUTES attr;
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);
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);