ctdb-common: No dynamic memory allocation in mkdir_p()
authorMartin Schwenke <martin@meltin.net>
Wed, 11 Jun 2014 06:58:20 +0000 (16:58 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 12 Jun 2014 03:40:10 +0000 (05:40 +0200)
commitdd672431c0b8a3a416f6c244b131074d868250cc
tree719b05607ea558d15f25889e4bcedd2302c0d23c
parent8fa8b3b397853a29f12875454b890fa5c7b8cda8
ctdb-common: No dynamic memory allocation in mkdir_p()

Allocate an array of size PATH_MAX on the stack instead.  To stop
unnecessary recursion, try to create the desired directory before
creating ancestors and only create ancestors on ENOENT.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/system_common.c