Fix some FTP compile errors when debug is on

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3657 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-06-01 23:33:39 +00:00
parent c4b747f9f9
commit ead92a8517
4 changed files with 9 additions and 6 deletions

View File

@ -41,6 +41,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <errno.h>
#include <debug.h> #include <debug.h>
#include "ftpc_internal.h" #include "ftpc_internal.h"
@ -163,7 +164,7 @@ int ftpc_cmd(struct ftpc_session_s *session, const char *cmd, ...)
if (ret < 0) if (ret < 0)
{ {
ndbg("Error sending cmd: %s, %d\n" cmd, errno); ndbg("Error sending cmd %s: %d\n", cmd, errno);
goto errout; goto errout;
} }
@ -172,7 +173,7 @@ int ftpc_cmd(struct ftpc_session_s *session, const char *cmd, ...)
ret = fptc_getreply(session); ret = fptc_getreply(session);
if (ret < 0) if (ret < 0)
{ {
ndbg("Error getting reply: %d\n" errno); ndbg("Error getting reply: %d\n", errno);
goto errout; goto errout;
} }

View File

@ -166,7 +166,7 @@ int ftpc_reconnect(FAR struct ftpc_session_s *session)
#ifdef CONFIG_DEBUG #ifdef CONFIG_DEBUG
tmp = inet_ntoa(session->addr); tmp = inet_ntoa(session->addr);
ndbg("Connecting to server address %s:%d\n", ndbg("Connecting to server address %s:%d\n",
server->proxy ? "proxy" : "server", tmp, ntohl(session->port)); tmp, ntohl(session->port));
free(tmp); free(tmp);
#endif #endif
@ -212,10 +212,10 @@ int ftpc_reconnect(FAR struct ftpc_session_s *session)
#ifdef CONFIG_DEBUG #ifdef CONFIG_DEBUG
ndbg("Connected\n"); ndbg("Connected\n");
tmp = inet_ntoa(session->cmd.raddr.sin_addr.s_addr); tmp = inet_ntoa(session->cmd.raddr.sin_addr);
ndbg(" Remote address: %s:%d\n", tmp, ntohl(session->cmd.raddr.sin_port)); ndbg(" Remote address: %s:%d\n", tmp, ntohl(session->cmd.raddr.sin_port));
free(tmp); free(tmp);
tmp = inet_ntoa(session->cmd.laddr.sin_addr.s_addr); tmp = inet_ntoa(session->cmd.laddr.sin_addr);
ndbg(" Local address: %s:d\n", tmp, ntohl(session->cmd.laddr.sin_port)); ndbg(" Local address: %s:d\n", tmp, ntohl(session->cmd.laddr.sin_port));
free(tmp); free(tmp);
#endif #endif

View File

@ -44,6 +44,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <libgen.h> #include <libgen.h>
#include <errno.h>
#include <debug.h> #include <debug.h>
#include <apps/ftpc.h> #include <apps/ftpc.h>

View File

@ -44,6 +44,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <libgen.h> #include <libgen.h>
#include <errno.h>
#include <debug.h> #include <debug.h>
#include <apps/ftpc.h> #include <apps/ftpc.h>
@ -398,7 +399,7 @@ int ftp_putfile(SESSION handle, const char *lname, const char *rname,
ret = fseek(finstream, session->offset, SEEK_SET); ret = fseek(finstream, session->offset, SEEK_SET);
if (ret != OK) if (ret != OK)
{ {
ndbg("fseek failed: %d\n", errnoo); ndbg("fseek failed: %d\n", errno);
fclose(finstream); fclose(finstream);
return ERROR; return ERROR;
} }