summaryrefslogtreecommitdiffstats
path: root/cpukit/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-03-05 21:48:10 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-03-09 17:15:20 +0100
commit83994913b6603c3a0dbb5ece4b3b5b47457ed99e (patch)
treea2684dcdfbcc0172140a4c9828c734497ff4695e /cpukit/include
parentimfs: Use _IMFS_get_time() (diff)
downloadrtems-83994913b6603c3a0dbb5ece4b3b5b47457ed99e.tar.bz2
imfs: Constify imfs_memfile_bytes_per_block
The CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK value is validated by <rtems/confdefs/libio.h>. Changing this value during runtime could lead to memory corruption. Update #3894.
Diffstat (limited to 'cpukit/include')
-rw-r--r--cpukit/include/rtems/confdefs/libio.h2
-rw-r--r--cpukit/include/rtems/imfs.h3
2 files changed, 2 insertions, 3 deletions
diff --git a/cpukit/include/rtems/confdefs/libio.h b/cpukit/include/rtems/confdefs/libio.h
index aced98b3b9..3c45771952 100644
--- a/cpukit/include/rtems/confdefs/libio.h
+++ b/cpukit/include/rtems/confdefs/libio.h
@@ -196,7 +196,7 @@ static const devFS_data _Filesystem_Root_data = {
#error "CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK must be a power of two between 16 and 512"
#endif
-int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
+const int imfs_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
static IMFS_fs_info_t _IMFS_fs_info;
diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h
index 565d103226..09e8bd4a9d 100644
--- a/cpukit/include/rtems/imfs.h
+++ b/cpukit/include/rtems/imfs.h
@@ -66,8 +66,7 @@ typedef struct IMFS_jnode_tt IMFS_jnode_t;
* @endcode
*/
#define IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK 128
- extern int imfs_rq_memfile_bytes_per_block;
- extern int imfs_memfile_bytes_per_block;
+ extern const int imfs_memfile_bytes_per_block;
#define IMFS_MEMFILE_BYTES_PER_BLOCK imfs_memfile_bytes_per_block
#define IMFS_MEMFILE_BLOCK_SLOTS \