Handle mkdir() return code.

This commit is contained in:
Michael Jumper 2013-10-24 17:40:30 -07:00
parent 39c31faa9b
commit 70b361b8b6

View File

@ -239,8 +239,10 @@ int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path,
} }
/* Create directory first, if necessary */ /* Create directory first, if necessary */
if (file_attributes & FILE_ATTRIBUTE_DIRECTORY && (flags & O_CREAT)) if (file_attributes & FILE_ATTRIBUTE_DIRECTORY && (flags & O_CREAT)) {
mkdir(real_path, S_IRWXU); if (mkdir(real_path, S_IRWXU))
return guac_rdpdr_fs_get_errorcode(errno);
}
/* Open file */ /* Open file */
fd = open(real_path, flags, S_IRUSR | S_IWUSR); fd = open(real_path, flags, S_IRUSR | S_IWUSR);