summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-04-23 20:33:25 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-04-23 20:33:25 +0000
commit914d40635782a7be3ee9fb721943d5d771d7be2b (patch)
tree34fc95aa94c99c8990295e1c6db3fe3411a29204 /apps
parentd59be21e24f0afc69d1363133b44dee32edcb633 (diff)
NFS updates
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4647 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'apps')
-rw-r--r--apps/nshlib/nsh_fscmds.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c
index db01d6d906..b1a0963cf7 100644
--- a/apps/nshlib/nsh_fscmds.c
+++ b/apps/nshlib/nsh_fscmds.c
@@ -55,7 +55,7 @@
# include <nuttx/fs/mkfatfs.h>
# endif
# ifdef CONFIG_NFS
-# include <netinet/in.h>
+# include <sys/socket.h>
# include <nuttx/fs/nfs.h>
# endif
#endif
@@ -1230,8 +1230,8 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
#else
struct in_addr inaddr;
#endif
+ bool tcp = false;
int ret;
- int tcp = 0;
/* Get the NFS mount options */
@@ -1267,15 +1267,11 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
if (protocol)
{
- if (!strncmp(protocol, "tcp", 3))
+ if (strncmp(protocol, "tcp", 3) == 0)
{
- tcp = 1;
+ tcp = true;
}
- else if (!strncmp(protocol, "udp", 3))
- {
- tcp = 0;
- }
- else
+ else if (!strncmp(protocol, "udp", 3) != 0)
{
nsh_output(vtbl, g_fmtarginvalid, argv[0]);
badarg = true;
@@ -1344,7 +1340,7 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
memset(&data, 0, sizeof(data));
data.version = 3;
data.proto = (tcp) ? 6 : 17;
- dato.sotype = (tcp) ? 0 : 1;
+ data.sotype = (tcp) ? 0 : 1;
sin->sin_family = 2;
sin->sin_port = htons(2049);
sin->sin_addr = inaddr;