From 70b361b8b64fb367b0c4ec3b5b67845e5686e1ad Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 24 Oct 2013 17:40:30 -0700 Subject: [PATCH] Handle mkdir() return code. --- src/protocols/rdp/guac_rdpdr/rdpdr_fs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c index 5357c693..4820379b 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c @@ -239,8 +239,10 @@ int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path, } /* Create directory first, if necessary */ - if (file_attributes & FILE_ATTRIBUTE_DIRECTORY && (flags & O_CREAT)) - mkdir(real_path, S_IRWXU); + if (file_attributes & FILE_ATTRIBUTE_DIRECTORY && (flags & O_CREAT)) { + if (mkdir(real_path, S_IRWXU)) + return guac_rdpdr_fs_get_errorcode(errno); + } /* Open file */ fd = open(real_path, flags, S_IRUSR | S_IWUSR);