summaryrefslogtreecommitdiff
path: root/src/shared/dlt_offline_trace.c
diff options
context:
space:
mode:
authorDinh Cong Toan <toan.dinhcong@vn.bosch.com>2021-05-25 16:28:21 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-06-30 10:54:59 +0900
commit1e7d374593ae34c5f1b343a213123d5385852fe7 (patch)
tree8df78ee5c1112874dc0d4d7c682ff559cbc2d04f /src/shared/dlt_offline_trace.c
parent3bb7eb24092ff771ccfd1119f8c1088f3f78f981 (diff)
downloadDLT-daemon-1e7d374593ae34c5f1b343a213123d5385852fe7.tar.gz
dlt message header broken
This commit is to revert the following commits: - de4a4234 - fb9ff078 - db9917b3 - e4467f0e - a567e01d Those commits are from improvement but they seem to break the dlt message header in some cases. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
Diffstat (limited to 'src/shared/dlt_offline_trace.c')
-rw-r--r--src/shared/dlt_offline_trace.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/dlt_offline_trace.c b/src/shared/dlt_offline_trace.c
index 909252b..2d70a77 100644
--- a/src/shared/dlt_offline_trace.c
+++ b/src/shared/dlt_offline_trace.c
@@ -85,7 +85,7 @@ unsigned int dlt_offline_trace_storage_dir_info(char *path, char *file_name, cha
return 0;
for (i = 0; i < cnt; i++) {
- size_t len = 0;
+ int len = 0;
len = strlen(file_name);
if ((strncmp(files[i]->d_name, file_name, len) == 0) &&
@@ -166,7 +166,7 @@ unsigned int dlt_offline_trace_get_idx_of_log_file(char *file)
token = strtok(NULL, d);
if (token != NULL)
- idx = (unsigned int) strtol(token, NULL, 10);
+ idx = strtol(token, NULL, 10);
else
idx = 0;
@@ -307,7 +307,7 @@ int dlt_offline_trace_delete_oldest_file(DltOfflineTrace *trace)
if (0 == stat(filename, &status)) {
if ((time_oldest == 0) || (status.st_mtime < time_oldest)) {
time_oldest = status.st_mtime;
- size_oldest = (unsigned long) status.st_size;
+ size_oldest = status.st_size;
strncpy(filename_oldest, filename, PATH_MAX);
filename_oldest[PATH_MAX] = 0;
}
@@ -414,21 +414,21 @@ DltReturnValue dlt_offline_trace_write(DltOfflineTrace *trace,
/* write data into log file */
if (data1 && (trace->ohandle >= 0)) {
- if (write(trace->ohandle, data1, (size_t) size1) != size1) {
+ if (write(trace->ohandle, data1, size1) != size1) {
printf("Offline trace write failed!\n");
return DLT_RETURN_ERROR;
}
}
if (data2 && (trace->ohandle >= 0)) {
- if (write(trace->ohandle, data2, (size_t) size2) != size2) {
+ if (write(trace->ohandle, data2, size2) != size2) {
printf("Offline trace write failed!\n");
return DLT_RETURN_ERROR;
}
}
if (data3 && (trace->ohandle >= 0)) {
- if (write(trace->ohandle, data3, (size_t) size3) != size3) {
+ if (write(trace->ohandle, data3, size3) != size3) {
printf("Offline trace write failed!\n");
return DLT_RETURN_ERROR;
}