aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-05-07 21:28:53 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-05-07 21:28:53 +0000
commitf8aae275a462e1d6c45ba188169ba8d4b408a27f (patch)
tree8aebaf5be7e5f406bd43dcc06d8121987f0e3311
parent186420eccf901499b2503548e0cd51c76f781954 (diff)
downloadnewlib-f8aae275a462e1d6c45ba188169ba8d4b408a27f.zip
newlib-f8aae275a462e1d6c45ba188169ba8d4b408a27f.tar.gz
newlib-f8aae275a462e1d6c45ba188169ba8d4b408a27f.tar.bz2
* fhandler_mem.cc (fhandler_dev_mem::fhandler_dev_mem): Move
initialization of "mem_size" from here... (fhandler_dev_mem::open): ...to here. Fix typo in FH_PORT case.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/fhandler_mem.cc32
2 files changed, 19 insertions, 19 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 20c7419..c8cc30a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_mem.cc (fhandler_dev_mem::fhandler_dev_mem): Move
+ initialization of "mem_size" from here...
+ (fhandler_dev_mem::open): ...to here. Fix typo in FH_PORT case.
+
2004-05-07 Gerd Spalink <Gerd.Spalink@t-online.de>
* fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Move delete of
diff --git a/winsup/cygwin/fhandler_mem.cc b/winsup/cygwin/fhandler_mem.cc
index 1688ab0..64bf8e5 100644
--- a/winsup/cygwin/fhandler_mem.cc
+++ b/winsup/cygwin/fhandler_mem.cc
@@ -25,11 +25,20 @@
fhandler_dev_mem::fhandler_dev_mem ()
: fhandler_base ()
{
- /* Reading physical memory only supported on NT/W2K. */
+}
+
+fhandler_dev_mem::~fhandler_dev_mem (void)
+{
+}
+
+int
+fhandler_dev_mem::open (int flags, mode_t)
+{
if (!wincap.has_physical_mem_access ())
{
- mem_size = 0;
- return;
+ set_errno (ENOENT);
+ debug_printf ("%s is accessible under NT/W2K only", dev ().name);
+ return 0;
}
if (dev () == FH_MEM) /* /dev/mem */
@@ -53,7 +62,7 @@ fhandler_dev_mem::fhandler_dev_mem ()
mem_size = 0;
debug_printf ("KMemSize: %d MB", mem_size >> 20);
}
- else if (dev () == FH_ZERO) /* /dev/port == First 64K of /dev/mem */
+ else if (dev () == FH_PORT) /* /dev/port == First 64K of /dev/mem */
{
mem_size = 65536;
debug_printf ("PortSize: 64 KB");
@@ -63,21 +72,6 @@ fhandler_dev_mem::fhandler_dev_mem ()
mem_size = 0;
debug_printf ("Illegal minor number!!!");
}
-}
-
-fhandler_dev_mem::~fhandler_dev_mem (void)
-{
-}
-
-int
-fhandler_dev_mem::open (int flags, mode_t)
-{
- if (!wincap.has_physical_mem_access ())
- {
- set_errno (ENOENT);
- debug_printf ("%s is accessible under NT/W2K only", dev ().name);
- return 0;
- }
/* Check for illegal flags. */
if (flags & (O_APPEND | O_TRUNC | O_EXCL))