summaryrefslogtreecommitdiff
path: root/src/console
diff options
context:
space:
mode:
authorLutz Helwing <lutz_helwing@mentor.com>2015-09-22 10:49:29 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2015-10-07 10:37:19 +0200
commit4c8d43322e89b87288fb5ba12e523237e620481b (patch)
tree202bc05d45f14f7f30dd3826362811d3ce8840fd /src/console
parente5ffa017047525ed2e3ee41ea2294546ee64894c (diff)
downloadDLT-daemon-4c8d43322e89b87288fb5ba12e523237e620481b.tar.gz
Fixed whitespace and formatting of new code Fixed licence headers
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/console')
-rw-r--r--src/console/dlt-logstorage-ctrl.c28
-rw-r--r--src/console/dlt-receive.c16
2 files changed, 27 insertions, 17 deletions
diff --git a/src/console/dlt-logstorage-ctrl.c b/src/console/dlt-logstorage-ctrl.c
index 4e34c6f..24742f0 100644
--- a/src/console/dlt-logstorage-ctrl.c
+++ b/src/console/dlt-logstorage-ctrl.c
@@ -1,25 +1,31 @@
-/**
+/*
* @licence app begin@
+ * SPDX license identifier: MPL-2.0
+ *
* Copyright (C) 2013 - 2015 Advanced Driver Information Technology.
* This code is developed by Advanced Driver Information Technology.
- * Copyright of Advanced Driver Information Technology, Bosch and DENSO.
- *
- * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
+ * Copyright of Advanced Driver Information Technology, Bosch and DENSO
*
+ * This file is part of GENIVI Project DLT - Diagnostic Log and Trace.
*
- * \copyright
* This Source Code Form is subject to the terms of the
- * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
- * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
+ * Mozilla Public License (MPL), v. 2.0.
+ * If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
*
+ * For further information see http://www.genivi.org/.
+ * @licence end@
+ */
+
+/*!
* \author Syed Hameed <shameed@jp.adit-jv.com> ADIT 2013 - 2015
* \author Christoph Lipka <clipka@jp.adit-jv.com> ADIT 2015
*
+ * \copyright Copyright © 2013-2015 Advanced Driver Information Technology. \n
+ * License MPL-2.0: Mozilla Public License version 2.0 http://mozilla.org/MPL/2.0/.
+ *
* \file dlt-logstorage-ctrl.c
- * For further information see http://www.genivi.org/.
- * @licence end@
- */
+*/
/*******************************************************************************
** **
diff --git a/src/console/dlt-receive.c b/src/console/dlt-receive.c
index 071c1ba..99268e5 100644
--- a/src/console/dlt-receive.c
+++ b/src/console/dlt-receive.c
@@ -493,14 +493,14 @@ int main(int argc, char* argv[])
{
if (dltdata.climit > -1)
{
- char tmp[256];
- snprintf(tmp, 256, "Using file size limit of %li bytes\n", dltdata.climit);
- dlt_log(LOG_INFO, tmp);
- dltdata.ohandle = dlt_receive_open_output_file(&dltdata);
+ char tmp[256];
+ snprintf(tmp, 256, "Using file size limit of %li bytes\n", dltdata.climit);
+ dlt_log(LOG_INFO, tmp);
+ dltdata.ohandle = dlt_receive_open_output_file(&dltdata);
}
else /* in case no limit for the output file is given, we simply overwrite any existing file */
{
- dltdata.ohandle = open(dltdata.ovalue, O_WRONLY|O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ dltdata.ohandle = open(dltdata.ovalue, O_WRONLY|O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
}
if (dltdata.ohandle == -1)
@@ -612,17 +612,21 @@ int dlt_receive_message_callback(DltMessage *message, void *data)
if (dltdata->climit > -1)
{
int bytes_to_write = message->headersize + message->datasize;
+
if ((bytes_to_write + dltdata->totalbytes > dltdata->climit))
{
- dlt_receive_close_output_file(dltdata);
+ dlt_receive_close_output_file(dltdata);
+
if (dlt_receive_open_output_file(dltdata) < 0)
{
printf("ERROR: dlt_receive_message_callback: Unable to open log when maximum filesize was reached!\n");
return -1;
}
+
dltdata->totalbytes = 0;
}
}
+
bytes_written = writev(dltdata->ohandle, iov, 2);
dltdata->totalbytes += bytes_written;