From 6aeafe34c3051fc766f4d9beb10f2c09350b53fa Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Mon, 28 Apr 2025 08:52:11 +0200 Subject: [PATCH] switch to reading read-only There is no need to writing into the journals --- lib/src/journal/file.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/src/journal/file.c b/lib/src/journal/file.c index a225e6f..3c1d363 100644 --- a/lib/src/journal/file.c +++ b/lib/src/journal/file.c @@ -209,7 +209,7 @@ static EDErrorCode ed_journal_file_load(EDJournalFile *self, EDJournalFilePrivate *p = ed_journal_file_get_instance_private(self); GFile *file = NULL; - GFileIOStream *stream = NULL; + GFileInputStream *stream = NULL; GDataInputStream *reader = NULL; EDJournalEntry *entry = NULL; GError *e = NULL; @@ -219,15 +219,13 @@ static EDErrorCode ed_journal_file_load(EDJournalFile *self, file = g_file_new_for_path(p->filename); goto_if_true(file == NULL, done); - stream = g_file_open_readwrite(file, NULL, &e); + stream = g_file_read(file, NULL, &e); if (stream == NULL) { g_propagate_error(error, e); goto done; } - reader = g_data_input_stream_new( - g_io_stream_get_input_stream(G_IO_STREAM(stream)) - ); + reader = g_data_input_stream_new(G_INPUT_STREAM(stream)); if (reader == NULL) { goto done; }