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:
authorChristopher Faylor <me@cgf.cx>2001-10-16 18:04:26 +0400
committerChristopher Faylor <me@cgf.cx>2001-10-16 18:04:26 +0400
commit5a23087628d97436694f92a3a467523fe9870f76 (patch)
tree823098e0b373d47577dc3b338d3bbd9c644391d6
parentf636c08124eb708cdb8fbd0d226e1800e9fc09b4 (diff)
* mmap.cc (mmap): Assign 'fh' from cygheap_fdget. Use 'fh' everywhere.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/mmap.cc7
2 files changed, 8 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 23569a805..c23c8dfd3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2001-10-16 Christopher Faylor <cgf@redhat.com>
+
+ * mmap.cc (mmap): Assign 'fh' from cygheap_fdget. Use 'fh' everywhere.
+
2001-10-15 Christopher Faylor <cgf@redhat.com>
* cygerrno.h (set_errno): Define more informative version of this
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 1aa7f669f..664ce95ab 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -445,7 +445,7 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t off)
DWORD gran_off = off & ~(granularity - 1);
DWORD gran_len = howmany (len, granularity) * granularity;
- fhandler_base *fh = NULL;
+ fhandler_base *fh;
caddr_t base = addr;
HANDLE h;
@@ -459,14 +459,15 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t off)
ReleaseResourceLock(LOCK_MMAP_LIST, READ_LOCK | WRITE_LOCK, "mmap");
return MAP_FAILED;
}
- if (cfd->get_device () == FH_DISK)
+ fh = cfd;
+ if (fh->get_device () == FH_DISK)
{
DWORD fsiz = GetFileSize (fh->get_handle (), NULL);
fsiz -= gran_off;
if (gran_len > fsiz)
gran_len = fsiz;
}
- else if (cfd->get_device () == FH_ZERO)
+ else if (fh->get_device () == FH_ZERO)
/* mmap /dev/zero is like MAP_ANONYMOUS. */
fd = -1;
}