From 1f3b7b5687b5b8f06a57497214fbf45ad3367f28 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 21 May 2018 14:38:37 -0700 Subject: [PATCH] AP_HAL_Linux: Storage: fix writing garbage while creating file By the time we create the storage we hadn't still initialized the buffer. Remove the writes during storage creation since ftruncate() will take care of the file size aspect and MAX storage write chunk is taken care by Linux according to the media/fs that is there. --- libraries/AP_HAL_Linux/Storage.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libraries/AP_HAL_Linux/Storage.cpp b/libraries/AP_HAL_Linux/Storage.cpp index 7ac342c9d7..40d9f288c7 100644 --- a/libraries/AP_HAL_Linux/Storage.cpp +++ b/libraries/AP_HAL_Linux/Storage.cpp @@ -117,12 +117,6 @@ void Storage::_storage_create(void) STORAGE_FILE); } - for (uint16_t loc=0; loc