]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/lsfd-fifo.c
2 * lsfd-fifo.c - handle associations opening fifo objects
4 * Copyright (C) 2021 Red Hat, Inc. All rights reserved.
5 * Written by Masatake YAMATO <yamato@redhat.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it would be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software Foundation,
19 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "libsmartcols.h"
28 static bool fifo_fill_column(struct proc
*proc
__attribute__((__unused__
)),
30 struct libscols_line
*ln
,
38 if (scols_line_set_data(ln
, column_index
, "FIFO"))
39 err(EXIT_FAILURE
, _("failed to add output data"));
42 if (major(file
->stat
.st_dev
) == 0
43 && strncmp(file
->name
, "pipe:", 5) == 0) {
44 str
= strdup("pipefs");
53 err(EXIT_FAILURE
, _("failed to add output data"));
54 if (scols_line_refer_data(ln
, column_index
, str
))
55 err(EXIT_FAILURE
, _("failed to add output data"));
59 const struct file_class fifo_class
= {
61 .size
= sizeof(struct file
),
62 .fill_column
= fifo_fill_column
,