[LTP] [PATCH 1/2] lib/tst_test: setup TCID earlier in do_setup()
Alexey Kodanev
aleksei.kodanev@bell-sw.com
Mon Jun 28 11:47:57 CEST 2021
Hi Li, Cyril,
On 25.06.2021 12:27, Cyril Hrubis wrote:
> Hi!
>> TCID can be NULL in tst_tmpdir() because it is set after do_setup():
>>
>> tst_run_tcases()
>> do_setup()
>> ...
>> tid = get_tid();
>> ...
>> tst_tmpdir() /* using TCID here */
>> TCID = tid;
>
> Good catch, I wonder how we missed this for so long...
Ran into this with musl, it pastes "(null)" to the tmpdir path if
TCID is NULL, so the final template looked like "/tmp/(nuXXXXXX".
But glibc skips it because the same string doesn't fit in 3 chars
template in snprintf(..., "%s/%.3sXXXXXX",...).
Applied the patch. Thanks for review!
More information about the ltp
mailing list