summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-05-03 14:53:28 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-05-03 14:53:28 -0400
commit31151da3c4ae7f5331559f6de37b8c77d9acea3e (patch)
tree6239db50dc9dd5f0fb2db4e172e95ea93ec1a894 /src
parent2a6e0ea1b61b364c7ae40fd0bce97b1b888652d4 (diff)
src/shared/util.h: import xsprintf() from upstream.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--src/shared/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index 0dc46f103f..2aa8da0989 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -224,6 +224,8 @@ char* dirname_malloc(const char *path);
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
+#define xsprintf(buf, fmt, ...) assert_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf))
+
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
int touch(const char *path);