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:
parent
c07e3830b3
commit
bd73e017b0
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user