Skip to contentSkip to conversation

timezone: Fix compare_file comparison in timezone checking

PATCH Superseded Michael Trimarchi 1 participant 1 message May 15, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 timezone: Fix compare_file comparison in timezone checking

The patch allow to compare file only when are not in the same path. The compare_file is used to understand if the set timezone if the same we are going to set

---
 src/timezone.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/timezone.c +2 -2
index 89c44895..fba8b925 100644
@@ -124,8 +124,8 @@ static int compare_file(void *src_map, struct stat *src_st,
 
 	DBG("real path %s path name %s", real_path, pathname);
 
-	if (real_path && g_strcmp0(real_path, pathname))
-		return -1;
+	if (real_path && !g_strcmp0(real_path, pathname))
+		return 0;
 
 	fd = open(pathname, O_RDONLY | O_CLOEXEC);
 	if (fd < 0)
Signature · 1 line
2.43.0