summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-10-01 15:40:18 (UTC)
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-10-02 13:27:34 (UTC)
commit86f6e8b73b7190aa6e1cc2610d7603d4429acbae (patch)
treea82ce7b643cfbf555e1adb2b6051ba566d2b7c0c
parent52c8df84cab07464271675fd822d37f2f3e860d2 (diff)
downloadrtems-86f6e8b73b7190aa6e1cc2610d7603d4429acbae.tar.bz2
nfsclient: PR2075: Fix node initialization
-rw-r--r--cpukit/libfs/src/nfsclient/src/nfs.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c
index bbec6b8..97d1ba5 100644
--- a/cpukit/libfs/src/nfsclient/src/nfs.c
+++ b/cpukit/libfs/src/nfsclient/src/nfs.c
@@ -1387,7 +1387,7 @@ static void nfs_eval_set_handlers(
}
}
-static int nfs_move_node(NfsNode dst, const NfsNode src)
+static int nfs_move_node(NfsNode dst, const NfsNode src, const char *part)
{
int rv = 0;
@@ -1402,20 +1402,17 @@ static int nfs_move_node(NfsNode dst, const NfsNode src)
}
*dst = *src;
- dst->str = NULL;
- if (src->args.name != NULL) {
- dst->str = dst->args.name = strdup(src->args.name);
- if (dst->str != NULL) {
+ dst->str = dst->args.name = strdup(part);
+ if (dst->str != NULL) {
#if DEBUG & DEBUG_COUNT_NODES
- rtems_interrupt_level flags;
- rtems_interrupt_disable(flags);
- dst->nfs->stringsInUse++;
- rtems_interrupt_enable(flags);
+ rtems_interrupt_level flags;
+ rtems_interrupt_disable(flags);
+ dst->nfs->stringsInUse++;
+ rtems_interrupt_enable(flags);
#endif
- } else {
- rv = -1;
- }
+ } else {
+ rv = -1;
}
return rv;
@@ -1446,7 +1443,7 @@ static rtems_filesystem_eval_path_generic_status nfs_eval_part(
if (type == NFLNK && (follow_sym_link || !terminal)) {
nfs_eval_follow_link(ctx, &entry);
} else {
- rv = nfs_move_node(dir, &entry);
+ rv = nfs_move_node(dir, &entry, part);
if (rv == 0) {
nfs_eval_set_handlers(ctx, type);
if (!terminal) {