chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do no isolate in case of emergency or severe problems
[elogind.git]
/
src
/
login
/
sysfs-show.c
diff --git
a/src/login/sysfs-show.c
b/src/login/sysfs-show.c
index 172c75d82b0fc4c3a5215eadfd6be2e5a720a1cf..3c03bd1f2e78f57480b4198d94b3fe3b49caeb36 100644
(file)
--- a/
src/login/sysfs-show.c
+++ b/
src/login/sysfs-show.c
@@
-45,6
+45,7
@@
static int show_sysfs_one(
struct udev_device *d;
const char *sn, *name, *sysfs, *subsystem, *sysname;
char *l, *k;
struct udev_device *d;
const char *sn, *name, *sysfs, *subsystem, *sysname;
char *l, *k;
+ bool is_master;
sysfs = udev_list_entry_get_name(*item);
if (!path_startswith(sysfs, sub))
sysfs = udev_list_entry_get_name(*item);
if (!path_startswith(sysfs, sub))
@@
-60,13
+61,15
@@
static int show_sysfs_one(
if (isempty(sn))
sn = "seat0";
if (isempty(sn))
sn = "seat0";
- /*
fixme,
also check for tag 'seat' here */
+ /*
Explicitly
also check for tag 'seat' here */
if (!streq(seat, sn) || !udev_device_has_tag(d, "seat")) {
udev_device_unref(d);
*item = udev_list_entry_get_next(*item);
continue;
}
if (!streq(seat, sn) || !udev_device_has_tag(d, "seat")) {
udev_device_unref(d);
*item = udev_list_entry_get_next(*item);
continue;
}
+ is_master = udev_device_has_tag(d, "master-of-seat");
+
name = udev_device_get_sysattr_value(d, "name");
if (!name)
name = udev_device_get_sysattr_value(d, "id");
name = udev_device_get_sysattr_value(d, "name");
if (!name)
name = udev_device_get_sysattr_value(d, "id");
@@
-105,12
+108,13
@@
static int show_sysfs_one(
}
k = ellipsize(sysfs, n_columns, 20);
}
k = ellipsize(sysfs, n_columns, 20);
- printf("%s%s
%s\n", prefix, draw_special_char(lookahead ? DRAW_BOX_VERT_AND_RIGHT : DRAW_BOX_UP_AND
_RIGHT),
-
k ? k : sysfs);
+ printf("%s%s
%s\n", prefix, draw_special_char(lookahead ? DRAW_TREE_BRANCH : DRAW_TREE
_RIGHT),
+ k ? k : sysfs);
free(k);
if (asprintf(&l,
free(k);
if (asprintf(&l,
- "(%s:%s)%s%s%s",
+ "%s%s:%s%s%s%s",
+ is_master ? "[MASTER] " : "",
subsystem, sysname,
name ? " \"" : "", name ? name : "", name ? "\"" : "") < 0) {
udev_device_unref(d);
subsystem, sysname,
name ? " \"" : "", name ? name : "", name ? "\"" : "") < 0) {
udev_device_unref(d);
@@
-118,8
+122,8
@@
static int show_sysfs_one(
}
k = ellipsize(l, n_columns, 70);
}
k = ellipsize(l, n_columns, 70);
- printf("%s%s
%s\n", prefix, lookahead ? draw_special_char(DRAW_BOX_VERT) : "
",
-
k ? k : l);
+ printf("%s%s
%s\n", prefix, lookahead ? draw_special_char(DRAW_TREE_VERT) : "
",
+ k ? k : l);
free(k);
free(l);
free(k);
free(l);
@@
-127,7
+131,7
@@
static int show_sysfs_one(
if (*item) {
char *p;
if (*item) {
char *p;
- p = str
join(prefix, lookahead ? draw_special_char(DRAW_BOX_VERT) : " ", " ", NULL
);
+ p = str
append(prefix, lookahead ? draw_special_char(DRAW_TREE_VERT) : " "
);
show_sysfs_one(udev, seat, item, sysfs, p ? p : prefix, n_columns - 2);
free(p);
}
show_sysfs_one(udev, seat, item, sysfs, p ? p : prefix, n_columns - 2);
free(p);
}