public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Joerg Vehlow <lkml@jv-coder.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] tst_wallclock: Prevent fail on read-only /etc/localtime
Date: Wed,  1 Sep 2021 07:17:04 +0200	[thread overview]
Message-ID: <20210901051704.1672590-1-lkml@jv-coder.de> (raw)

From: Joerg Vehlow <joerg.vehlow@aox-tech.de>

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

Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de>
---
 lib/tst_wallclock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_wallclock.c b/lib/tst_wallclock.c
index 1244ea26b..ee53e2b7f 100644
--- a/lib/tst_wallclock.c
+++ b/lib/tst_wallclock.c
@@ -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);
 }
-- 
2.25.1


             reply	other threads:[~2021-09-01  5:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  5:17 Joerg Vehlow [this message]
2021-09-01  8:00 ` [LTP] [PATCH] tst_wallclock: Prevent fail on read-only /etc/localtime Petr Vorel
2021-09-09 11:40   ` Petr Vorel
2021-09-09 11:40     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210901051704.1672590-1-lkml@jv-coder.de \
    --to=lkml@jv-coder.de \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox