From bf69faeb0db5c4b237f38326b20e32ff7d1ad9ba Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 18 Mar 2011 13:42:03 +0000 Subject: * 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. --- winsup/cygwin/mmap.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/mmap.cc') 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; } -- cgit v1.2.3