Commit 4ea8bd02 authored by topjohnwu's avatar topjohnwu

Fix incorrect use of compare_exchange

parent ee0d58a9
...@@ -28,8 +28,8 @@ static const string *default_cert; ...@@ -28,8 +28,8 @@ static const string *default_cert;
bool need_pkg_refresh() { bool need_pkg_refresh() {
struct stat st{}; struct stat st{};
stat("/data/system/packages.xml", &st); stat("/data/system/packages.xml", &st);
ino_t ino = st.st_ino; ino_t ino = pkg_xml_ino.exchange(st.st_ino);
if (pkg_xml_ino.compare_exchange_strong(ino, st.st_ino)) { if (ino == st.st_ino) {
// Packages have not changed // Packages have not changed
return false; return false;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment