From: David Goulet Date: Mon, 16 Sep 2013 18:01:06 +0000 (-0400) Subject: Fix: return -errno value on error in run_as mkdir X-Git-Tag: v2.4.0-rc1~144 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7ce3675685dbbc7be9536eb9c2b5ff8d677dc0b5;p=lttng-tools.git Fix: return -errno value on error in run_as mkdir Signed-off-by: David Goulet --- diff --git a/src/common/runas.c b/src/common/runas.c index 6979ad325..3ae2e4c38 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -96,8 +96,15 @@ int _mkdir_recursive(void *_data) static int _mkdir(void *_data) { + int ret; struct run_as_mkdir_data *data = _data; - return mkdir(data->path, data->mode); + + ret = mkdir(data->path, data->mode); + if (ret < 0) { + ret = -errno; + } + + return ret; } static