1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

common: New function ctdb_mkdir_p_or_die()

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7b971df79b0b63f83555205eacf48d49ca3a273a)
This commit is contained in:
Martin Schwenke 2013-10-21 19:29:39 +11:00 committed by Amitay Isaacs
parent c07e3830b3
commit bd73e017b0
2 changed files with 15 additions and 0 deletions

View File

@ -811,3 +811,17 @@ void ctdb_set_runstate(struct ctdb_context *ctdb, enum ctdb_runstate runstate)
runstate_to_string(runstate), runstate));
ctdb->runstate = runstate;
}
void ctdb_mkdir_p_or_die(struct ctdb_context *ctdb, 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(ret)));
exit(1);
}
}

View File

@ -1589,5 +1589,6 @@ struct lock_request *ctdb_lock_alldb(struct ctdb_context *ctdb,
void *private_data);
int mkdir_p(const char *dir, int mode);
void ctdb_mkdir_p_or_die(struct ctdb_context *ctdb, const char *dir, int mode);
#endif