From: Cyril Hrubis <chrubis@suse.cz>
To: Avinesh Kumar <akumar@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/6] Remove unnecessary header includes
Date: Tue, 21 Jun 2022 12:24:42 +0200 [thread overview]
Message-ID: <YrGcahVSR5fC5rus@yuki> (raw)
In-Reply-To: <20220617172025.23975-4-akumar@suse.de>
Hi!
> ---
> testcases/kernel/syscalls/utime/utime03.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/utime/utime03.c b/testcases/kernel/syscalls/utime/utime03.c
> index 2358fd70b..0c64518d2 100644
> --- a/testcases/kernel/syscalls/utime/utime03.c
> +++ b/testcases/kernel/syscalls/utime/utime03.c
> @@ -18,11 +18,8 @@
> * - The user ID of the process has write access to the file.
> */
>
> -#include <sys/types.h>
> #include <pwd.h>
> #include <utime.h>
> -#include <sys/stat.h>
> -#include <time.h>
>
> #include "tst_test.h"
> #include "tst_uid.h"
> @@ -60,7 +57,7 @@ static void run(void)
> struct stat statbuf;
> time_t mintime, maxtime;
>
> - utbuf.modtime = time(0) - 5;
> + utbuf.modtime = tst_get_fs_timestamp() - 5;
This change is not explained in the patch description moreover ideally
patches should do one logical change so if we are going to accept these
changes they should be split into a patch that removes includes and
patch that replaces the time(0).
Although usage of time(0) is not really critical here, the difference
between the time(0) and tst_get_fs_timestamp() is that they may be out
of sync by 1 second as they are not incremenented at the exactly same
time. Hence it does not matter if we set time 5 +-1 seconds in the past
since the result is 100% different from current time.
> utbuf.actime = utbuf.modtime + 1;
> TST_EXP_PASS_SILENT(utime(TEMP_FILE, &utbuf));
> SAFE_STAT(TEMP_FILE, &statbuf);
> --
> 2.36.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-06-21 10:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 17:20 [LTP] [PATCH 0/6] Convert utime tests to new LTP API Avinesh Kumar
2022-06-17 17:20 ` [LTP] [PATCH 1/6] Rewrite utime01.c using " Avinesh Kumar
2022-06-21 10:17 ` Cyril Hrubis
2022-06-17 17:20 ` [LTP] [PATCH 2/6] Rewrite utime02.c " Avinesh Kumar
2022-06-21 10:19 ` Cyril Hrubis
2022-06-17 17:20 ` [LTP] [PATCH 3/6] Remove unnecessary header includes Avinesh Kumar
2022-06-21 10:24 ` Cyril Hrubis [this message]
2022-06-17 17:20 ` [LTP] [PATCH 4/6] Rewrite utime04.c using new LTP API Avinesh Kumar
2022-06-21 12:38 ` Cyril Hrubis
2022-06-17 17:20 ` [LTP] [PATCH 5/6] Rewrite utime05.c " Avinesh Kumar
2022-06-21 12:40 ` Cyril Hrubis
2022-06-17 17:20 ` [LTP] [PATCH 6/6] Rewrite utime06.c " Avinesh Kumar
2022-06-21 12:59 ` Cyril Hrubis
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=YrGcahVSR5fC5rus@yuki \
--to=chrubis@suse.cz \
--cc=akumar@suse.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