Fix: return -errno value on error in run_as mkdir
authorDavid Goulet <dgoulet@ev0ke.net>
Mon, 16 Sep 2013 18:01:06 +0000 (14:01 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 27 Sep 2013 16:18:04 +0000 (12:18 -0400)
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
src/common/runas.c

index 6979ad3257c1da144955b6567ad7ce16afacdbaa..3ae2e4c38d35e5d943f8ca9f3e49213d14472ed4 100644 (file)
@@ -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
This page took 0.026328 seconds and 4 git commands to generate.