From: Masatake YAMATO Date: Mon, 2 Oct 2023 14:00:41 +0000 (+0900) Subject: lsfd: call xinfo backend method before calling socket generic method when filling... X-Git-Tag: v2.40-rc1~210^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4479119177f7453b46c6a2180d97f88c9cbe4af;p=thirdparty%2Futil-linux.git lsfd: call xinfo backend method before calling socket generic method when filling columns Signed-off-by: Masatake YAMATO --- diff --git a/misc-utils/lsfd-sock.c b/misc-utils/lsfd-sock.c index 7da2f61e58..ee0aa737a6 100644 --- a/misc-utils/lsfd-sock.c +++ b/misc-utils/lsfd-sock.c @@ -55,6 +55,15 @@ static bool sock_fill_column(struct proc *proc __attribute__((__unused__)), { char *str = NULL; struct sock *sock = (struct sock *)file; + + if (sock->xinfo && sock->xinfo->class + && sock->xinfo->class->fill_column) { + if (sock->xinfo->class->fill_column(proc, sock->xinfo, sock, ln, + column_id, column_index, + &str)) + goto out; + } + switch(column_id) { case COL_TYPE: if (!sock->protoname) @@ -112,16 +121,10 @@ static bool sock_fill_column(struct proc *proc __attribute__((__unused__)), : "0"); break; default: - if (sock->xinfo && sock->xinfo->class - && sock->xinfo->class->fill_column) { - if (sock->xinfo->class->fill_column(proc, sock->xinfo, sock, ln, - column_id, column_index, - &str)) - break; - } return false; } + out: if (!str) err(EXIT_FAILURE, _("failed to add output data")); if (scols_line_refer_data(ln, column_index, str))