timezone: Fix compare_file comparison in timezone checking
PATCH v2 1/1 timezone: Fix compare_file comparison in timezone checking
The original condition incorrectly returned -1 when the real path and the provided pathname matched, due to a flawed use of g_strcmp0. This patch corrects the logic to return 0 (success) when the paths match, ensuring proper file comparison behavior.
---V1->V2: Improve commit message
--- src/timezone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/timezone.c +2 -2
@@ -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
Denis Kenzior
AppliedHi Michael,
Quoted 7 lines · Michael Trimarchi
The original condition incorrectly returned -1 when the real path and the provided pathname matched, due to a flawed use of
g_strcmp0. This patch corrects the logic to return 0 (success) when the paths match, ensuring proper file comparison behavior.Signed-off-by Andrea Ricchi <[email protected]>Signed-off-by Michael Trimarchi <[email protected]>
No Signed-off-by used by ConnMan, I dropped these.
Quoted 5 lines
---
V1->V2: Improve commit message--- src/timezone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Regards,
-Denis
This patch was applied to connman.git (master) by Denis Kenzior <[email protected]>:
Hello:
This patch was applied to connman.git (master)
by Denis Kenzior <[email protected]>:
Quoted 9 lines · On Thu, 15 May 2025 13:44:09 +0200 you wrote:
The original condition incorrectly returned -1 when the real path and the provided pathname matched, due to a flawed use of
g_strcmp0. This patch corrects the logic to return 0 (success) when the paths match, ensuring proper file comparison behavior.Signed-off-by Andrea Ricchi <[email protected]>Signed-off-by Michael Trimarchi <[email protected]>[...]
Here is the summary with links:
- [V2] timezone: Fix compare_file comparison in timezone checking
https://git.kernel.org/pub/scm/network/connman/connman.git/?id=f20ccd19a62b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html