diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-06-06 15:25:08 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2014-06-12 05:40:10 +0200 |
commit | 49e34651a95a336c9e410e4b52a8cfd491ca0a67 (patch) | |
tree | 7ce194e44b4838e2d8292988f1a2c145d70c3583 /ctdb/common/system_util.c | |
parent | 4736486188afb8ff6243bcc8a27daa9dbcc64b7a (diff) | |
download | samba-49e34651a95a336c9e410e4b52a8cfd491ca0a67.tar.gz |
ctdb-common: Move mkdir_p_or_die to system utilities
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/common/system_util.c')
-rw-r--r-- | ctdb/common/system_util.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c index d2d9b31e820..6a5f454f8f0 100644 --- a/ctdb/common/system_util.c +++ b/ctdb/common/system_util.c @@ -349,3 +349,17 @@ int mkdir_p(const char *dir, int mode) return ret; } + +void mkdir_p_or_die(const char *dir, int mode) +{ + int ret; + + ret = mkdir_p(dir, mode); + if (ret != 0) { + DEBUG(DEBUG_ALERT, + ("ctdb exiting with error: " + "failed to create directory \"%s\" (%s)\n", + dir, strerror(errno))); + exit(1); + } +} |