mirror of
https://github.com/AltraMayor/f3.git
synced 2025-08-03 18:46:00 -04:00
f3brew: test if device moved after reset
Devices might change their names after a reset. This patch simply adds the same warning that f3probe already has to f3brew.
This commit is contained in:
parent
c47a7642fb
commit
add20ef7ae
11
f3brew.c
11
f3brew.c
@ -498,8 +498,17 @@ int main(int argc, char **argv)
|
||||
|
||||
if (args.test_write)
|
||||
test_write_blocks(dev, args.first_block, args.last_block);
|
||||
if (args.test_write && args.test_read)
|
||||
|
||||
if (args.test_write && args.test_read) {
|
||||
const char *final_dev_filename;
|
||||
|
||||
assert(!dev_reset(dev));
|
||||
final_dev_filename = dev_get_filename(dev);
|
||||
if (strcmp(args.filename, final_dev_filename))
|
||||
printf("\nWARNING: device `%s' moved to `%s' due to the reset\n\n",
|
||||
args.filename, final_dev_filename);
|
||||
}
|
||||
|
||||
if (args.test_read)
|
||||
test_read_blocks(dev, args.first_block, args.last_block);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user