Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2019-02-15 15:29:01 -0500
committerEugene Tarassov2019-02-15 15:29:01 -0500
commitc7bcdf7cd513161faf3f937bed53cd0ed211f814 (patch)
tree36b5c4088f812000b8e7a6b03cf34b9636ede35f
parent13fc9ee526e7a32935b58a6ae286239013e194db (diff)
downloadorg.eclipse.tcf.agent-c7bcdf7cd513161faf3f937bed53cd0ed211f814.tar.gz
org.eclipse.tcf.agent-c7bcdf7cd513161faf3f937bed53cd0ed211f814.tar.xz
org.eclipse.tcf.agent-c7bcdf7cd513161faf3f937bed53cd0ed211f814.zip
TCF Agent: VxWorks mkdir changed to support two parameters
-rw-r--r--agent/tcf/services/filesystem.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/agent/tcf/services/filesystem.c b/agent/tcf/services/filesystem.c
index 84a566eb..3ca8b9bb 100644
--- a/agent/tcf/services/filesystem.c
+++ b/agent/tcf/services/filesystem.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2018 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2019 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
@@ -1353,9 +1353,6 @@ static void command_mkdir(char * token, Channel * c) {
char path[FILE_PATH_SIZE];
FileAttrs attrs;
int err = 0;
-#if !defined(_WRS_KERNEL)
- int mode;
-#endif
read_path(&c->inp, path, sizeof(path));
json_test_char(&c->inp, MARKER_EOA);
@@ -1367,11 +1364,15 @@ static void command_mkdir(char * token, Channel * c) {
json_test_char(&c->inp, MARKER_EOA);
json_test_char(&c->inp, MARKER_EOM);
-#if defined(_WRS_KERNEL)
+#if defined(_WRS_KERNEL) && !defined(_WRS_CONFIG_CORE_POSIX_MKDIR)
if (mkdir(path) < 0) err = errno;
#else
- mode = (attrs.flags & ATTR_PERMISSIONS) ? attrs.permissions : 0777;
- if (mkdir(path, mode) < 0) err = errno;
+ if (attrs.flags & ATTR_PERMISSIONS) {
+ if (mkdir(path, attrs.permissions) < 0) err = errno;
+ }
+ else {
+ if (mkdir(path, 0777) < 0) err = errno;
+ }
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
if (attrs.win32_attrs != INVALID_FILE_ATTRIBUTES) {

Back to the top