[PATCH] setup ftpd root before task start

xiangfu at sharism.cc xiangfu at sharism.cc
Tue Dec 20 06:46:05 UTC 2011


From: Xiangfu <xiangfu at sharism.cc>

Signed-off-by: Xiangfu <xiangfu at sharism.cc>
---
 cpukit/ftpd/ftpd.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/cpukit/ftpd/ftpd.c b/cpukit/ftpd/ftpd.c
index 6e06f24..6c62f8f 100644
--- a/cpukit/ftpd/ftpd.c
+++ b/cpukit/ftpd/ftpd.c
@@ -2068,6 +2068,14 @@ rtems_initialize_ftpd(void)
 
   ftpd_access = rtems_ftpd_configuration.access;
 
+  if (
+    rtems_ftpd_configuration.root &&
+    rtems_ftpd_configuration.root[0] == '/'
+  )
+    ftpd_root = rtems_ftpd_configuration.root;
+
+  rtems_ftpd_configuration.root = ftpd_root;
+
   if (rtems_ftpd_configuration.tasks_count <= 0)
     rtems_ftpd_configuration.tasks_count = 1;
   count = rtems_ftpd_configuration.tasks_count;
@@ -2100,15 +2108,6 @@ rtems_initialize_ftpd(void)
     return RTEMS_UNSATISFIED;
   }
 
-  ftpd_root = "/";
-  if (
-    rtems_ftpd_configuration.root &&
-    rtems_ftpd_configuration.root[0] == '/'
-  )
-    ftpd_root = rtems_ftpd_configuration.root;
-
-  rtems_ftpd_configuration.root = ftpd_root;
-
   syslog(LOG_INFO, "ftpd: FTP daemon started (%d session%s max)",
     count, ((count > 1) ? "s" : ""));
 
-- 
1.7.4.1




More information about the devel mailing list