changeset 2696:b1cdd12003cd

* src/synth.c: Fixed error check of mmap call.
author asl
date Mon, 22 Dec 2008 20:05:02 +0000
parents af1007ef13b5
children d6e76cd040e3
files packages/devs/flash/synth/current/ChangeLog packages/devs/flash/synth/current/src/synth.c packages/devs/flash/synthv2/current/ChangeLog packages/devs/flash/synthv2/current/src/synth.c
diffstat 4 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/flash/synth/current/ChangeLog
+++ b/packages/devs/flash/synth/current/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-18  Simon Kallweit  <simon.kallweit@intefo.ch>
+
+	* src/synth.c: Fixed error check of mmap call.
+
 2008-11-19  Simon Kallweit  <simon.kallweit@intefo.ch>
 
 	* tests/flash2.c: Fixed a few warnings.
--- a/packages/devs/flash/synth/current/src/synth.c
+++ b/packages/devs/flash/synth/current/src/synth.c
@@ -124,9 +124,9 @@ flash_hwr_init(void)
                 |CYG_HAL_SYS_MAP_FIXED
 #endif
                 , cyg_dev_flash_synth_flashfd, 0 );
-    CYG_ASSERT( cyg_dev_flash_synth_base > 0, "mmap of flash file failed!" );
+    CYG_ASSERT( cyg_dev_flash_synth_base != (void *) -1, "mmap of flash file failed!" );
 
-    if (cyg_dev_flash_synth_base <= 0) {
+    if (cyg_dev_flash_synth_base == (void *) -1) {
         return FLASH_ERR_HWR;
     }
     flash_info.start = cyg_dev_flash_synth_base;
--- a/packages/devs/flash/synthv2/current/ChangeLog
+++ b/packages/devs/flash/synthv2/current/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-18  Simon Kallweit  <simon.kallweit@intefo.ch>
+
+	* src/synth.c: Fixed error check of mmap call.
+
 2008-11-28  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
 
 	* tests/flash[23].c: Fixed copy'n'paste typos in a naming: flash1 ->
--- a/packages/devs/flash/synthv2/current/src/synth.c
+++ b/packages/devs/flash/synthv2/current/src/synth.c
@@ -120,8 +120,8 @@ synth_flash_init(struct cyg_flash_dev *d
         flags,
         priv->flashfd, 
         0l);
-    CYG_ASSERT( (int) base > 0, "mmap of flash file failed!" );
-    if (base <= 0) {
+    CYG_ASSERT( base != -1, "mmap of flash file failed!" );
+    if (base == -1) {
         return CYG_FLASH_ERR_HWR;
     }
     dev->start = base;