diff mbox series

[1/1] tst_tmpdir: Add 'LTP_' prefix

Message ID 20230110183555.6915-1-pvorel@suse.cz
State Accepted
Headers show
Series [1/1] tst_tmpdir: Add 'LTP_' prefix | expand

Commit Message

Petr Vorel Jan. 10, 2023, 6:35 p.m. UTC
Follow the approach of the shell API:

    TST_TMPDIR=$(mktemp -d "$TMPDIR/LTP_$TST_ID.XXXXXXXXXX")

Prefix helps to see directories mounted by LTP.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_tmpdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Avinesh Kumar Jan. 11, 2023, 1:18 p.m. UTC | #1
Hi,

Reviewed-by: Avinesh Kumar <akumar@suse.de>

On Wednesday, January 11, 2023 12:05:55 AM IST Petr Vorel wrote:
> Follow the approach of the shell API:
> 
>     TST_TMPDIR=$(mktemp -d "$TMPDIR/LTP_$TST_ID.XXXXXXXXXX")
> 
> Prefix helps to see directories mounted by LTP.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  lib/tst_tmpdir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/tst_tmpdir.c b/lib/tst_tmpdir.c
> index d1419a1a40..b73b5c66f7 100644
> --- a/lib/tst_tmpdir.c
> +++ b/lib/tst_tmpdir.c
> @@ -269,7 +269,7 @@ void tst_tmpdir(void)
>  	 * use our default TEMPDIR.
>  	 */
>  	env_tmpdir = tst_get_tmpdir_root();
> -	snprintf(template, PATH_MAX, "%s/%.3sXXXXXX", env_tmpdir, TCID);
> +	snprintf(template, PATH_MAX, "%s/LTP_%.3sXXXXXX", env_tmpdir, TCID);
>  
>  	/* Make the temporary directory in one shot using mkdtemp. */
>  	if (mkdtemp(template) == NULL) {
> 

Regards,
Avinesh
Richard Palethorpe Jan. 12, 2023, 10:33 a.m. UTC | #2
Hello,

Merged, thanks!

Avinesh Kumar <akumar@suse.de> writes:

> Hi,
>
> Reviewed-by: Avinesh Kumar <akumar@suse.de>
>
> On Wednesday, January 11, 2023 12:05:55 AM IST Petr Vorel wrote:
>> Follow the approach of the shell API:
>> 
>>     TST_TMPDIR=$(mktemp -d "$TMPDIR/LTP_$TST_ID.XXXXXXXXXX")
>> 
>> Prefix helps to see directories mounted by LTP.
>> 
>> Signed-off-by: Petr Vorel <pvorel@suse.cz>
>> ---
>>  lib/tst_tmpdir.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/lib/tst_tmpdir.c b/lib/tst_tmpdir.c
>> index d1419a1a40..b73b5c66f7 100644
>> --- a/lib/tst_tmpdir.c
>> +++ b/lib/tst_tmpdir.c
>> @@ -269,7 +269,7 @@ void tst_tmpdir(void)
>>  	 * use our default TEMPDIR.
>>  	 */
>>  	env_tmpdir = tst_get_tmpdir_root();
>> -	snprintf(template, PATH_MAX, "%s/%.3sXXXXXX", env_tmpdir, TCID);
>> +	snprintf(template, PATH_MAX, "%s/LTP_%.3sXXXXXX", env_tmpdir, TCID);
>>  
>>  	/* Make the temporary directory in one shot using mkdtemp. */
>>  	if (mkdtemp(template) == NULL) {
>> 
>
> Regards,
> Avinesh
diff mbox series

Patch

diff --git a/lib/tst_tmpdir.c b/lib/tst_tmpdir.c
index d1419a1a40..b73b5c66f7 100644
--- a/lib/tst_tmpdir.c
+++ b/lib/tst_tmpdir.c
@@ -269,7 +269,7 @@  void tst_tmpdir(void)
 	 * use our default TEMPDIR.
 	 */
 	env_tmpdir = tst_get_tmpdir_root();
-	snprintf(template, PATH_MAX, "%s/%.3sXXXXXX", env_tmpdir, TCID);
+	snprintf(template, PATH_MAX, "%s/LTP_%.3sXXXXXX", env_tmpdir, TCID);
 
 	/* Make the temporary directory in one shot using mkdtemp. */
 	if (mkdtemp(template) == NULL) {