Re: [PATCH 3/3] lsirq,irqtop: add support for reading data from given file

Karel Zak
2025-02-27T09:30:21Z

On Wed, Feb 26, 2025 at 08:49:16PM GMT, Joe Jin wrote:
> + if (ctl->input == NULL) {
> + if (ctl->softirq == 1)
> + ctl->input = strdup(_PATH_PROC_SOFTIRQS);
> + else
> + ctl->input = strdup(_PATH_PROC_INTERRUPTS);
> + if (!ctl->input)
> + err_oom();
> + }

Please, use xstrdup(), than you do not need to care about result and
use err_oom();

Karel
--
Karel Zak <kzak@redhat.com>