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>2011-03-18 16:42:03 +0300
committerCorinna Vinschen <corinna@vinschen.de>2011-03-18 16:42:03 +0300
commitbf69faeb0db5c4b237f38326b20e32ff7d1ad9ba (patch)
treec86bd91d060e65587f06ae0f365034ae61565196 /winsup/cygwin/mmap.cc
parentac706ac1232169dc8bd9f1adfe3410e36df571bc (diff)
* mmap.cc (class mmap_record): Pack 4 byte-aligned. Convert member dev
to plain int. (mmap_record::alloc_fh): Create temporary device from dev and use in call to build_fh_dev.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index f04366b54..4d29d5f5c 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -245,6 +245,7 @@ MapView (HANDLE h, void *addr, size_t len, DWORD openflags,
per mapped memory page. The bit is set if the page is accessible,
unset otherwise. */
+#pragma pack(push, 4)
class mmap_record
{
public:
@@ -259,7 +260,7 @@ class mmap_record
_off64_t offset;
DWORD len;
caddr_t base_address;
- device dev;
+ int dev;
DWORD page_map[0];
public:
@@ -274,16 +275,16 @@ class mmap_record
len (l),
base_address (b)
{
- dev.devn = 0;
+ dev = 0;
if (fd >= 0 && !cygheap->fdtab.not_open (fd))
dev = cygheap->fdtab[fd]->dev ();
else if (fd == -1)
- dev.parse (FH_ZERO);
+ dev = FH_ZERO;
}
int get_fd () const { return fd; }
HANDLE get_handle () const { return mapping_hdl; }
- device& get_device () { return dev; }
+ int get_device () { return dev; }
int get_prot () const { return prot; }
int get_openflags () const { return openflags; }
int get_flags () const { return flags; }
@@ -316,6 +317,7 @@ class mmap_record
{ return ::gen_protect (get_prot (), get_flags ()); }
bool compatible_flags (int fl) const;
};
+#pragma pack(pop)
class mmap_list
{
@@ -519,7 +521,9 @@ mmap_record::alloc_fh ()
the call to fork(). This requires creating a fhandler
of the correct type to be sure to call the method of the
correct class. */
- fhandler_base *fh = build_fh_dev (get_device ());
+ device fdev;
+ fdev.parse (get_device ());
+ fhandler_base *fh = build_fh_dev (fdev, "");
fh->set_access (get_openflags ());
return fh;
}