From 5379928defc81fc3826d84a634893c27394da59f Mon Sep 17 00:00:00 2001 From: Alexander Mohr Date: Thu, 29 Jul 2021 12:55:23 +0200 Subject: file-transfer: Abort file transfer if get serial number failed If a file is deleted while a file transfer is ongoing, the file transfer tries to seek through the whole file. This is due to the fact the the file handle is held open. getFileSerialNumber is already validating the file by using stat. If this call returns a negative value, we know that a stat to the file is not possible anymore, therefore further reading can be aborted. --- include/dlt/dlt_filetransfer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/dlt/dlt_filetransfer.h b/include/dlt/dlt_filetransfer.h index 728dfbb..5404d1a 100644 --- a/include/dlt/dlt_filetransfer.h +++ b/include/dlt/dlt_filetransfer.h @@ -52,6 +52,8 @@ #define DLT_FILETRANSFER_ERROR_INFO_ABOUT -700 /* ! Error code for dlt_user_log_file_packagesCount */ #define DLT_FILETRANSFER_ERROR_PACKAGE_COUNT -800 +/* ! Error code for failed get serial number */ +#define DLT_FILETRANSFER_FILE_SERIAL_NUMBER -900 /* !Transfer the complete file as several dlt logs. */ -- cgit v1.2.1