Commit 0fc03fbb authored by Kevin Wolf's avatar Kevin Wolf

libc: errno für mkdir() setzen

! libc: Zumindest für LIOv2 bekommen wir einen Fehlercode vom Kernel
  zurück, den könnten wir dann eigentlich auch nach errno schreiben.
Signed-off-by: Kevin Wolf's avatarKevin Wolf <kevin@tyndur.org>
parent 1d6091af
......@@ -33,6 +33,7 @@
#include "dir.h"
#include <string.h>
#include <lostio.h>
#include <errno.h>
static struct dir_handle* new_opendir(const char* path)
{
......@@ -173,10 +174,14 @@ static bool new_directory_create(const char* path)
char* dir = io_split_dirname(abs);
char* file = io_split_filename(abs);
bool result = false;
lio_resource_t parent;
lio_resource_t parent, ret;
if ((parent = lio_resource(dir, 1)) >= 0) {
result = (lio_mkdir(parent, file) >= 0);
ret = lio_mkdir(parent, file);
result = (ret >= 0);
if (!result) {
errno = -ret;
}
}
free(dir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment