From 221439164eb6683a5af35540b24b5620e5d8ab19 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 8 Apr 2018 22:12:08 -0500 Subject: Add mkpath() for common case of mkpathat(), and #define magic constants. --- lib/lib.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/lib.c') diff --git a/lib/lib.c b/lib/lib.c index ea678011..27d14be7 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -204,6 +204,12 @@ int mkpathat(int atfd, char *dir, mode_t lastmode, int flags) return 0; } +// The common case +int mkpath(char *dir) +{ + return mkpathat(AT_FDCWD, dir, 0, MKPATHAT_MAKE); +} + // Split a path into linked list of components, tracking head and tail of list. // Filters out // entries with no contents. struct string_list **splitpath(char *path, struct string_list **list) -- cgit v1.2.3