chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
log: minor fixes
[elogind.git]
/
src
/
login
/
sysfs-show.c
diff --git
a/src/login/sysfs-show.c
b/src/login/sysfs-show.c
index 939bd6125e21f23a1d6598d0bc7d990daed78426..cb5bb5e5f7e63374e1caab40f3ff63a2fbacedcd 100644
(file)
--- a/
src/login/sysfs-show.c
+++ b/
src/login/sysfs-show.c
@@
-1,5
+1,3
@@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
/***
This file is part of systemd.
/***
This file is part of systemd.
@@
-21,12
+19,21
@@
#include <errno.h>
#include <string.h>
#include <errno.h>
#include <string.h>
+
+#if 0 /// elogind needs the systems udev header
+#include "libudev.h"
+#else
#include <libudev.h>
#include <libudev.h>
+#endif // 0
-#include "util.h"
-#include "
sysfs-show
.h"
+#include "
alloc-
util.h"
+#include "
locale-util
.h"
#include "path-util.h"
#include "path-util.h"
+#include "string-util.h"
+#include "sysfs-show.h"
+#include "terminal-util.h"
#include "udev-util.h"
#include "udev-util.h"
+#include "util.h"
static int show_sysfs_one(
struct udev *udev,
static int show_sysfs_one(
struct udev *udev,
@@
-107,13
+114,13
@@
static int show_sysfs_one(
if (!k)
return -ENOMEM;
if (!k)
return -ENOMEM;
- printf("%s%s%s\n", prefix,
draw_special_char(lookahead ? DRAW_TREE_BRANCH : DRAW_
TREE_RIGHT), k);
+ printf("%s%s%s\n", prefix,
special_glyph(lookahead ? TREE_BRANCH :
TREE_RIGHT), k);
if (asprintf(&l,
"%s%s:%s%s%s%s",
is_master ? "[MASTER] " : "",
subsystem, sysname,
if (asprintf(&l,
"%s%s:%s%s%s%s",
is_master ? "[MASTER] " : "",
subsystem, sysname,
- name ? " \"" : "",
name ? name : ""
, name ? "\"" : "") < 0)
+ name ? " \"" : "",
strempty(name)
, name ? "\"" : "") < 0)
return -ENOMEM;
free(k);
return -ENOMEM;
free(k);
@@
-121,13
+128,13
@@
static int show_sysfs_one(
if (!k)
return -ENOMEM;
if (!k)
return -ENOMEM;
- printf("%s%s%s\n", prefix, lookahead ?
draw_special_char(DRAW_TREE_VERT
) : " ", k);
+ printf("%s%s%s\n", prefix, lookahead ?
special_glyph(TREE_VERTICAL
) : " ", k);
*item = next;
if (*item) {
_cleanup_free_ char *p = NULL;
*item = next;
if (*item) {
_cleanup_free_ char *p = NULL;
- p = strappend(prefix, lookahead ?
draw_special_char(DRAW_TREE_VERT
) : " ");
+ p = strappend(prefix, lookahead ?
special_glyph(TREE_VERTICAL
) : " ");
if (!p)
return -ENOMEM;
if (!p)
return -ENOMEM;
@@
-180,7
+187,7
@@
int show_sysfs(const char *seat, const char *prefix, unsigned n_columns) {
if (first)
show_sysfs_one(udev, seat, &first, "/", prefix, n_columns);
else
if (first)
show_sysfs_one(udev, seat, &first, "/", prefix, n_columns);
else
- printf("%s%s%s\n", prefix,
draw_special_char(DRAW_
TREE_RIGHT), "(none)");
+ printf("%s%s%s\n", prefix,
special_glyph(
TREE_RIGHT), "(none)");
return r;
}
return r;
}