chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
systemctl: ellipsize job list only when necessary, highlight running
[elogind.git]
/
src
/
shared
/
util.h
diff --git
a/src/shared/util.h
b/src/shared/util.h
index 38851237ab15957762723d7023fb2bf12e6359bf..a8e962ea50af16365c2e9295defd275928c447da 100644
(file)
--- a/
src/shared/util.h
+++ b/
src/shared/util.h
@@
-647,4
+647,11
@@
static inline bool logind_running(void) {
return access("/run/systemd/seats/", F_OK) >= 0;
}
+static inline unsigned decimal_str_max(unsigned x) {
+ unsigned ans = 1;
+ while (x /= 10)
+ ans ++;
+ return ans;
+}
+
int unlink_noerrno(const char *path);