From: Christian Goeschel Ndjomouo Date: Sat, 30 Aug 2025 06:07:48 +0000 (-0400) Subject: lslocks: add support for LSLOCKS_COLUMNS environmental variable X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b05f661edbf00ab81ef8d387f801f2c80c93b21f;p=thirdparty%2Futil-linux.git lslocks: add support for LSLOCKS_COLUMNS environmental variable This provides an alternate way to specify output columns similar to the --output option. Addresses: #2816 Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index 4ed3a3716..ad8da240b 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -952,6 +952,8 @@ int main(int argc, char *argv[]) columns[ncolumns++] = COL_PATH; } + if (!outarg) + outarg = getenv("LSLOCKS_COLUMNS"); if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns), &ncolumns, column_name_to_id) < 0) return EXIT_FAILURE;