Skip to contentSkip to conversation

tst_wallclock: Prevent fail on read-only /etc/localtime

PATCH New Joerg Vehlow 2 participants 3 messages Sep 1, 2021 – Sep 9, 2021 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tst_wallclock: Prevent fail on read-only /etc/localtime

From: Joerg Vehlow <[email protected]>

If /etc/localtime is readonly, the time should not have changed anyway.

---
 lib/tst_wallclock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tst_wallclock.c +1 -1
index 1244ea26b..ee53e2b7f 100644
@@ -72,7 +72,7 @@ void tst_wallclock_restore(void)
 	 * might not be enough because the current access time might be far
 	 * in the future.
 	 */
-	ret = access(localtime, F_OK);
+	ret = access(localtime, F_OK | W_OK);
 	if (!ret)
 		SAFE_TOUCH(localtime, 0, NULL);
 }
Signature · 1 line
2.25.1
Applied
#2 lore raw

PATCH 1/1 tst_wallclock: Prevent fail on read-only /etc/localtime

Hi Joerg, all,

merged, thanks!

Kind regards,
Petr