# HG changeset patch # User asl # Date 1229976302 0 # Node ID b1cdd12003cdf47001342f2e9d426e57099d581a # Parent af1007ef13b509efb4ce757eed68a6d50b826f9a * src/synth.c: Fixed error check of mmap call. diff --git a/packages/devs/flash/synth/current/ChangeLog b/packages/devs/flash/synth/current/ChangeLog --- a/packages/devs/flash/synth/current/ChangeLog +++ b/packages/devs/flash/synth/current/ChangeLog @@ -1,3 +1,7 @@ +2008-12-18 Simon Kallweit + + * src/synth.c: Fixed error check of mmap call. + 2008-11-19 Simon Kallweit * tests/flash2.c: Fixed a few warnings. diff --git a/packages/devs/flash/synth/current/src/synth.c b/packages/devs/flash/synth/current/src/synth.c --- 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; diff --git a/packages/devs/flash/synthv2/current/ChangeLog b/packages/devs/flash/synthv2/current/ChangeLog --- a/packages/devs/flash/synthv2/current/ChangeLog +++ b/packages/devs/flash/synthv2/current/ChangeLog @@ -1,3 +1,7 @@ +2008-12-18 Simon Kallweit + + * src/synth.c: Fixed error check of mmap call. + 2008-11-28 Sergei Gavrikov * tests/flash[23].c: Fixed copy'n'paste typos in a naming: flash1 -> diff --git a/packages/devs/flash/synthv2/current/src/synth.c b/packages/devs/flash/synthv2/current/src/synth.c --- 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;