1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
From 26e46afd1f1f4ee67f6ee4b53aedc732a6bc378c Mon Sep 17 00:00:00 2001
From: Gianfranco Costamagna <locutusofborg@debian.org>
Date: Wed, 24 Dec 2025 08:30:24 +0100
Subject: [PATCH 1/2] Fix some build failures due to wrong code in gzip
handling:
/dlt-daemon/src/offlinelogstorage/dlt_offline_logstorage_behavior.c:1112:48: error: passing argument 1 of 'fileno' from incompatible pointer type [-Wincompatible-pointer-types]
1112 | if (fsync(fileno(config->gzlog)) != 0) {
| ~~~~~~^~~~~~~
| |
| gzFile {aka struct gzFile_s *}
/dlt-daemon/src/offlinelogstorage/dlt_offline_logstorage.c: In function 'dlt_logstorage_filter_config_free':
/dlt-daemon/src/offlinelogstorage/dlt_offline_logstorage.c:88:21: error: passing argument 1 of 'gzclose' from incompatible pointer type [-Wincompatible-pointer-types]
88 | gzclose(data->gzlog);
| ~~~~^~~~~~~
| |
| struct gzFile_s **
In file included from /dlt-daemon/src/offlinelogstorage/dlt_offline_logstorage.h:57,
from /dlt-daemon/src/offlinelogstorage/dlt_offline_logstorage.c:32:
/usr/include/zlib.h:1634:39: note: expected 'gzFile' {aka 'struct gzFile_s *'} but argument is of type 'struct gzFile_s **'
1634 | ZEXTERN int ZEXPORT gzclose(gzFile file);
| ~~~~~~~^~~~
/usr/include/zlib.h:1305:26: note: 'gzFile' declared here
1305 | typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
| ^~~~~~
---
src/offlinelogstorage/dlt_offline_logstorage.h | 2 +-
src/offlinelogstorage/dlt_offline_logstorage_behavior.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/offlinelogstorage/dlt_offline_logstorage.h b/src/offlinelogstorage/dlt_offline_logstorage.h
index fe386875a..09ea5ce47 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage.h
+++ b/src/offlinelogstorage/dlt_offline_logstorage.h
@@ -217,7 +217,7 @@ struct DltLogStorageFilterConfig
FILE *log; /* current open log file */
int fd; /* The file descriptor for the active log file */
#ifdef DLT_LOGSTORAGE_USE_GZIP
- gzFile *gzlog; /* current open gz log file */
+ gzFile gzlog; /* current open gz log file */
#endif
void *cache; /* log data cache */
unsigned int specific_size; /* cache size used for specific_size sync strategy */
diff --git a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
index f17fbb2fd..1b98d1275 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
+++ b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
@@ -1130,7 +1130,7 @@ int dlt_logstorage_prepare_on_msg(DltLogStorageFilterConfig *config,
(config->sync == DLT_LOGSTORAGE_SYNC_UNSET)) {
#ifdef DLT_LOGSTORAGE_USE_GZIP
if (config->gzip_compression == DLT_LOGSTORAGE_GZIP_ON) {
- if (fsync(fileno(config->gzlog)) != 0) {
+ if (fsync(config->fd) != 0) {
if (errno != ENOSYS) {
dlt_vlog(LOG_ERR, "%s: failed to sync gzip log file\n", __func__);
}
@@ -1138,7 +1138,7 @@ int dlt_logstorage_prepare_on_msg(DltLogStorageFilterConfig *config,
} else
#endif
{
- if (fsync(fileno(config->log)) != 0) {
+ if (fsync(config->fd) != 0) {
if (errno != ENOSYS) {
dlt_vlog(LOG_ERR, "%s: failed to sync log file\n", __func__);
}
From 7cd3d02c4a948e6d4ed531d25e20ba409bba9a5f Mon Sep 17 00:00:00 2001
From: Gianfranco Costamagna <locutusofborg@debian.org>
Date: Sat, 6 Dec 2025 10:39:37 +0100
Subject: [PATCH 2/2] Remvoe duplicate include on logstorage.c
---
src/offlinelogstorage/dlt_offline_logstorage.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/offlinelogstorage/dlt_offline_logstorage.c b/src/offlinelogstorage/dlt_offline_logstorage.c
index 151c10b9a..5bf5d6b2e 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage.c
+++ b/src/offlinelogstorage/dlt_offline_logstorage.c
@@ -24,7 +24,6 @@
#include <ctype.h>
#include <syslog.h>
#include <sys/stat.h>
-#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <time.h>
|