[v3,1/2] Revert "timezone: Fix compare_file comparison in timezone checking"

Message ID 20250603134542.67627-1-andrea.ricchi@amarulasolutions.com
State New
Headers show
Series
  • [v3,1/2] Revert "timezone: Fix compare_file comparison in timezone checking"
Related show

Commit Message

Andrea Ricchi June 3, 2025, 1:45 p.m. UTC
This reverts commit f20ccd19a62bd01aa117bfc8e7c388d2a16cde05.

`compare_file` is intended to work with symlinks, enabling
full and accurate matching between the requested timezone and the zoneinfo
database.

Signed-off-by: Andrea Ricchi <andrea.ricchi@amarulasolutions.com>
---
 Changes v2 -> v3:
  - Added to version v3

 src/timezone.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/src/timezone.c b/src/timezone.c
index fba8b925..89c44895 100644
--- a/src/timezone.c
+++ b/src/timezone.c
@@ -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 0;
+	if (real_path && g_strcmp0(real_path, pathname))
+		return -1;
 
 	fd = open(pathname, O_RDONLY | O_CLOEXEC);
 	if (fd < 0)