diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-23 20:33:25 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-23 20:33:25 +0000 |
commit | faf5098e0f900b5e5fcd6bea40e6ff9ff184e137 (patch) | |
tree | 34fc95aa94c99c8990295e1c6db3fe3411a29204 /apps/nshlib | |
parent | 942bbb7ad67be9b4117e752fcb4bcac280452f9f (diff) | |
download | nuttx-faf5098e0f900b5e5fcd6bea40e6ff9ff184e137.tar.gz nuttx-faf5098e0f900b5e5fcd6bea40e6ff9ff184e137.tar.bz2 nuttx-faf5098e0f900b5e5fcd6bea40e6ff9ff184e137.zip |
NFS updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4647 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/nshlib')
-rw-r--r-- | apps/nshlib/nsh_fscmds.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c index db01d6d90..b1a0963cf 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; |