diff options
author | Lassi Marttala <lassi.lm.marttala@partner.bmw.com> | 2012-03-14 10:29:46 +0100 |
---|---|---|
committer | Christian Muck <christian.muck@bmw.de> | 2012-04-04 14:28:23 +0200 |
commit | bd2b96363d98b35641567318b3ca568cf72cc593 (patch) | |
tree | 85baa51da5bd4751fda850120cf53ce78bc54446 /src/system/dlt-system-log.c | |
parent | 7dd2c3ba1a2ba499091a07264cff61b2156f76d6 (diff) | |
download | DLT-daemon-bd2b96363d98b35641567318b3ca568cf72cc593.tar.gz |
GDLT-2, Allow for enabling/disabling compression for the separate
directories.
Signed-off-by: Christian Muck <christian.muck@bmw.de>
Diffstat (limited to 'src/system/dlt-system-log.c')
-rw-r--r-- | src/system/dlt-system-log.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/system/dlt-system-log.c b/src/system/dlt-system-log.c index 9e56182..0c00154 100644 --- a/src/system/dlt-system-log.c +++ b/src/system/dlt-system-log.c @@ -230,6 +230,16 @@ void dlt_system_filetransfer_run(DltSystemOptions *options,DltSystemRuntime *run time_oldest = status.st_mtime; strcpy(runtime->filetransferFile,filename); runtime->filetransferFilesize = status.st_size; + + /* Compress the file if required */ + if(options->FiletransferCompression1 > 0) + { + printf("Start compression: %s\n",runtime->filetransferFile); + if(dlt_system_compress_file(runtime->filetransferFile, options->FiletransferCompressionLevel) < 0) + { + return; + } + } } } } @@ -246,7 +256,17 @@ void dlt_system_filetransfer_run(DltSystemOptions *options,DltSystemRuntime *run if((time_oldest == 0 || status.st_mtime < time_oldest) && (status.st_size != 0) && !dlt_system_is_z_file(filename)) { time_oldest = status.st_mtime; strcpy(runtime->filetransferFile,filename); - runtime->filetransferFilesize = status.st_size; + runtime->filetransferFilesize = status.st_size; + + /* Compress the file if required */ + if(options->FiletransferCompression2 > 0) + { + printf("Start compression: %s\n",runtime->filetransferFile); + if(dlt_system_compress_file(runtime->filetransferFile, options->FiletransferCompressionLevel) < 0) + { + return; + } + } } } } @@ -256,15 +276,6 @@ void dlt_system_filetransfer_run(DltSystemOptions *options,DltSystemRuntime *run /* start filetransfer if file exists */ if(runtime->filetransferFile[0]) { - /* Compress the file if required */ - if(options->FiletransferCompression > 0) - { - printf("Start compression: %s\n",runtime->filetransferFile); - if(dlt_system_compress_file(runtime->filetransferFile, options->FiletransferCompressionLevel) < 0) - { - return; - } - } printf("Start Filetransfer: %s\n",runtime->filetransferFile); runtime->filetransferCountPackages = dlt_user_log_file_packagesCount(context,runtime->filetransferFile); if(runtime->filetransferCountPackages < 0 ) |