summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {