summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index 38851237ab..a8e962ea50 100644
--- 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);