Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.12.2
-
None
-
4ebac33644d5db0b727680f1dacb18616daafe86 (qt/qtbase/5.12)
Description
Many embedded devices use read-only rootfs, at this case usually use intermediate symlink to zoneinfo file.
Result schema is /etc/localtime -> /tmp/localtime -> /usr/share/zoneinfo/ZONE_FILE
My solution is
@@ -1051,7 +1051,12 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const // On most distros /etc/localtime is a symlink to a real file so extract name from the path if (ianaId.isEmpty()) { - const QString path = QFile::symLinkTarget(QStringLiteral("/etc/localtime")); + QString path = QFile::symLinkTarget(QStringLiteral("/etc/localtime")); + if (!path.isEmpty()) { + const QString path2 = QFile::symLinkTarget(path); + if (!path2.isEmpty()) + path = path2; + } if (!path.isEmpty()) { // /etc/localtime is a symlink to the current TZ file, so extract from path int index = path.indexOf(QLatin1String("/zoneinfo/"));