summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-07-31 18:04:10 -0400
committerIan Stakenvicius <axs@gentoo.org>2013-07-31 18:04:10 -0400
commit9f49634fa3a6a5ac40bc8ff5d1c82c56eb38eef4 (patch)
tree71545cea89ef54eac2ef423d842e935f4abd3544
parentfd0b90dbb3cc1080244d6285ad2f3104dabbbcf9 (diff)
add new hexchar() call
Based on systemd commit fb624d04e56018defe297eff1d88888b192caeaa , added to support commit f8e6d758cd65b28f94b62344bd95e7bab94370d4 Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
-rw-r--r--src/libudev/util.c6
-rw-r--r--src/libudev/util.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libudev/util.c b/src/libudev/util.c
index 8fec6856e0..5abf6589af 100644
--- a/src/libudev/util.c
+++ b/src/libudev/util.c
@@ -999,6 +999,12 @@ int fd_inc_sndbuf(int fd, size_t n) {
return 1;
}
+char hexchar(int x) {
+ static const char table[16] = "0123456789abcdef";
+
+ return table[x & 15];
+}
+
bool in_initrd(void) {
static __thread int saved = -1;
struct statfs s;
diff --git a/src/libudev/util.h b/src/libudev/util.h
index 96a42bf3d3..f7058895c0 100644
--- a/src/libudev/util.h
+++ b/src/libudev/util.h
@@ -235,6 +235,8 @@ extern char **saved_argv;
int fd_inc_sndbuf(int fd, size_t n);
+char hexchar(int x);
+
bool in_initrd(void);
static inline void freep(void *p) {