From 7a8565498f9894a6d8fbb8cd4462048a4c603418 Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Wed, 31 May 2023 18:02:33 +0100 Subject: Make sure we open files as readonly when we're reading them so we don't create random new files This shouldn't happen anyway, but this change helps avoid error conditions --- daemon/logger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'daemon') diff --git a/daemon/logger.cpp b/daemon/logger.cpp index 9e0450e..65b5c2b 100644 --- a/daemon/logger.cpp +++ b/daemon/logger.cpp @@ -108,7 +108,7 @@ bool dayFileExists(QString sensorPrefix, QDateTime dateTime) { QStringList fileGetPrevRecord(QString sensorPrefix, QDateTime recordTime) { qDebug() << fileNameForDate(recordTime.date(), sensorPrefix); QFile file(fileNameForDate(recordTime.date(), sensorPrefix)); - if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) { + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { qDebug() << "failed to open file"; return {0,0}; } -- cgit v1.2.3-70-g09d2