From 736ec7da23f278dfa4a92830d67cc960f19da5d9 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 28 Jul 2015 14:36:08 -0700 Subject: [PATCH] GUAC-515: Clarify comments and formatting. Use simpler mkdir() logic. --- src/protocols/rdp/rdp_fs.c | 16 ++++++++-------- src/protocols/rdp/rdp_settings.h | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/protocols/rdp/rdp_fs.c b/src/protocols/rdp/rdp_fs.c index 025ee883..9a1b1edc 100644 --- a/src/protocols/rdp/rdp_fs.c +++ b/src/protocols/rdp/rdp_fs.c @@ -40,20 +40,20 @@ #include #include -guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path, int create_drive_path) { +guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path, + int create_drive_path) { /* Create drive path if it does not exist */ if (create_drive_path) { guac_client_log(client, GUAC_LOG_DEBUG, - "%s: Creating directory \"%s\".", + "%s: Creating directory \"%s\" if necessary.", __func__, drive_path); - if (mkdir(drive_path, S_IRWXU)) { - if (errno != EEXIST) { - guac_client_log(client, GUAC_LOG_DEBUG, - "%s: mkdir() failed: %s", - __func__, strerror(errno)); - } + /* Log error if directory creation fails */ + if (mkdir(drive_path, S_IRWXU) && errno != EEXIST) { + guac_client_log(client, GUAC_LOG_ERROR, + "Unable to create directory \"%s\": %s", + drive_path, strerror(errno)); } } diff --git a/src/protocols/rdp/rdp_settings.h b/src/protocols/rdp/rdp_settings.h index e77db5a0..e93ab9a1 100644 --- a/src/protocols/rdp/rdp_settings.h +++ b/src/protocols/rdp/rdp_settings.h @@ -156,7 +156,8 @@ typedef struct guac_rdp_settings { char* drive_path; /** - * Whether to automatically create the local system path if it does not exist. + * Whether to automatically create the local system path if it does not + * exist. */ int create_drive_path;