[PATCH v3 2/4] eal: fix errno not set if strftime return zero
David Marchand
david.marchand at redhat.com
Tue Jun 21 11:05:21 CEST 2022
On Fri, Jun 17, 2022 at 4:35 AM Chengwen Feng <fengchengwen at huawei.com> wrote:
>
> The trace_session_name_generate() takes errno as the return value, but
> the errno was not set if strftime return zero, the previously set errno
> is returned in this case, this will result in inaccurate prompting.
>
> This patch sets errno to ENOSPC if strftime return zero to fix it.
>
> Fixes: 321dd5f8fa62 ("trace: add internal init and fini interface")
> Cc: stable at dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Good catch.
With the next fix, the error condition (on trace_dir being too short
to accomodate with formatted date) cannot be reached anymore.
I squashed those two patches together.
I also updated the commitlog to give some details why we were getting
a EEXIST (or ENOENT) errno.
--
David Marchand
More information about the dev
mailing list