From 9f49634fa3a6a5ac40bc8ff5d1c82c56eb38eef4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 31 Jul 2013 18:04:10 -0400 Subject: add new hexchar() call Based on systemd commit fb624d04e56018defe297eff1d88888b192caeaa , added to support commit f8e6d758cd65b28f94b62344bd95e7bab94370d4 Signed-off-by: Ian Stakenvicius --- src/libudev/util.c | 6 ++++++ src/libudev/util.h | 2 ++ 2 files changed, 8 insertions(+) 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) { -- cgit v1.2.3-54-g00ecf