mkpath(dir, 0755) with umask 0027 silently creates a 0750 directory,
since mkdir(2) applies the umask to the requested mode. Callers pass
an explicit mode and expect exactly that.
Apply the mode with chmod() after each successful mkdir().
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Be consistent with errno codes from libite, we already have other APIs
that return ENOMEM if alloca() fails, so let's do the same for these
new ones as well.
Also, simplify va_start()/va_end() handling in these APIs, no point
in the extra complexity before this patch.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>