Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-12-20 12:35:18 +0300
committerCorinna Vinschen <corinna@vinschen.de>2008-12-20 12:35:18 +0300
commite9982f2a2b1b43489985b071adc86c90ccbbfcb0 (patch)
treed016d74867b7d0ae7addf756d2266f1eab285bac
parent99c7be03b2f080751c741b392779641fa1d38911 (diff)
* pwdgrp.h (pwdgrp::refresh): Fix indentation.
* uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated read. Drop local variable off.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/pwdgrp.h2
-rw-r--r--winsup/cygwin/uinfo.cc9
3 files changed, 11 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f9aec8bad..276b12057 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
diff --git a/winsup/cygwin/pwdgrp.h b/winsup/cygwin/pwdgrp.h
index 7db722c12..00ef2e87a 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 f9ed1a686..9b6733f22 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);