summaryrefslogtreecommitdiff
path: root/src/lib/ext.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-06-19 23:00:30 +0200
committerCarl Hetherington <cth@carlh.net>2022-06-21 18:55:16 +0200
commitfe933ebb2c55b4235fcba5d02af2ba91c272fc88 (patch)
tree26be0acf17bafd0787966518a1bc6c4dfacd9db2 /src/lib/ext.cc
parentc26e79a3598ff1b36f800823f178a0829d0fa547 (diff)
Stop using static initialisation so that dcpomatic::write() can be called more than once.
Diffstat (limited to 'src/lib/ext.cc')
-rw-r--r--src/lib/ext.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/ext.cc b/src/lib/ext.cc
index 96753eca4..5e2ff7d9c 100644
--- a/src/lib/ext.cc
+++ b/src/lib/ext.cc
@@ -285,12 +285,26 @@ try
{
ext4_dmask_set (DEBUG_ALL);
- /* We rely on static initialization for these */
- static struct ext4_fs fs;
- static struct ext4_mkfs_info info;
+ struct ext4_fs fs;
+ fs.read_only = false;
+ fs.bdev = nullptr;
+ fs.last_inode_bg_id = 0;
+ fs.jbd_fs = nullptr;
+ fs.jbd_journal = nullptr;
+ fs.curr_trans = nullptr;
+ struct ext4_mkfs_info info;
+ info.len = 0;
info.block_size = 4096;
+ info.blocks_per_group = 0;
info.inode_size = 128;
+ info.inodes = 0;
+ info.journal_blocks = 0;
+ info.dsc_size = 0;
+ for (int i = 0; i < UUID_SIZE; ++i) {
+ info.uuid[i] = rand() & 0xff;
+ }
info.journal = false;
+ info.label = nullptr;
#ifdef WIN32
file_windows_name_set(device.c_str());