summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_netcmds.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-12-29 15:02:51 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-12-29 15:02:51 -0600
commit9642e859e341e35fb01fd027d315f0195cb63358 (patch)
tree36f440f47bb43d7b4ac5b8d13f307fe17c434c52 /apps/nshlib/nsh_netcmds.c
parentad4c6ed3804621dfcbb782f32909de65f7506ea7 (diff)
downloadnuttx-9642e859e341e35fb01fd027d315f0195cb63358.tar.gz
nuttx-9642e859e341e35fb01fd027d315f0195cb63358.tar.bz2
nuttx-9642e859e341e35fb01fd027d315f0195cb63358.zip
Move nuttx/configs/stm3240g-eval/src/up_cxxinitialize.c to apps/platform/stm3240g-eval/
Diffstat (limited to 'apps/nshlib/nsh_netcmds.c')
-rw-r--r--apps/nshlib/nsh_netcmds.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c
index 3ff19a090..5c76aca0e 100644
--- a/apps/nshlib/nsh_netcmds.c
+++ b/apps/nshlib/nsh_netcmds.c
@@ -116,7 +116,7 @@
#if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0
struct tftpc_args_s
{
- bool binary; /* true:binary ("octect") false:text ("netascii") */
+ bool binary; /* true:binary ("octet") false:text ("netascii") */
bool allocated; /* true: destpath is allocated */
char *destpath; /* Path at destination */
const char *srcpath; /* Path at src */
@@ -502,6 +502,7 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
free(args.destpath);
}
+
free(fullpath);
return OK;
}
@@ -596,7 +597,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
}
/* If both the network interface name and an IP address are supplied as
- * arguments, then ifconfig will set the address of the ethernet device:
+ * arguments, then ifconfig will set the address of the Ethernet device:
*
* ifconfig nic_name ip_address
*/
@@ -677,7 +678,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ERROR;
}
- /* Set Hardware ethernet MAC addr */
+ /* Set Hardware Ethernet MAC address */
if (hw)
{
@@ -915,12 +916,12 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
(ipaddr >> 16 ) & 0xff, (ipaddr >> 24 ) & 0xff,
DEFAULT_PING_DATALEN);
- start = g_system_timer;
+ start = clock_systimer();
for (i = 1; i <= count; i++)
{
/* Send the ECHO request and wait for the response */
- next = g_system_timer;
+ next = clock_systimer();
seqno = uip_ping(ipaddr, id, i, DEFAULT_PING_DATALEN, maxwait);
/* Was any response returned? We can tell if a non-negative sequence
@@ -934,7 +935,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* to an earlier request, then fudge the elpased time.
*/
- elapsed = TICK2MSEC(g_system_timer - next);
+ elapsed = TICK2MSEC(clock_systimer() - next);
if (seqno < i)
{
elapsed += 100 * dsec * (i - seqno);
@@ -952,7 +953,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* to the current request!
*/
- elapsed = TICK2DSEC(g_system_timer - next);
+ elapsed = TICK2DSEC(clock_systimer() - next);
if (elapsed < dsec)
{
usleep(100000 * (dsec - elapsed));
@@ -961,7 +962,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Get the total elapsed time */
- elapsed = TICK2MSEC(g_system_timer - start);
+ elapsed = TICK2MSEC(clock_systimer() - start);
/* Calculate the percentage of lost packets */
@@ -1013,6 +1014,7 @@ int cmd_put(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
free(args.destpath);
}
+
free(fullpath);
return OK;
}
@@ -1123,7 +1125,7 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
nsh_output(vtbl, g_fmtcmdfailed, argv[0], "wget", NSH_ERRNO);
goto exit;
- }
+ }
/* Free allocated resources */
@@ -1132,18 +1134,22 @@ exit:
{
close(fd);
}
+
if (allocfile)
{
free(allocfile);
}
+
if (fullpath)
{
free(fullpath);
}
+
if (buffer)
{
free(buffer);
}
+
return ret;
errout: