mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
rexecd: fix type change
Fix cast from pointer to integer of different size to ensure proper type conversion and avoid compilation warnings. Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
This commit is contained in:
parent
34e4d7eacd
commit
c69df55cd0
3 changed files with 20 additions and 20 deletions
|
|
@ -140,11 +140,11 @@ static uint8_t ftpd_listoption(FAR char **param);
|
|||
static int ftpd_listbuffer(FAR struct ftpd_session_s *session,
|
||||
FAR char *path, FAR struct stat *st,
|
||||
FAR char *buffer, size_t buflen,
|
||||
unsigned int opton);
|
||||
unsigned int option);
|
||||
static int fptd_listscan(FAR struct ftpd_session_s *session,
|
||||
FAR char *path, unsigned int opton);
|
||||
FAR char *path, unsigned int option);
|
||||
static int ftpd_list(FAR struct ftpd_session_s *session,
|
||||
unsigned int opton);
|
||||
unsigned int option);
|
||||
|
||||
/* Command handlers */
|
||||
|
||||
|
|
@ -2145,7 +2145,7 @@ static uint8_t ftpd_listoption(FAR char **param)
|
|||
static int ftpd_listbuffer(FAR struct ftpd_session_s *session,
|
||||
FAR char *path,
|
||||
FAR struct stat *st, FAR char *buffer,
|
||||
size_t buflen, unsigned int opton)
|
||||
size_t buflen, unsigned int option)
|
||||
{
|
||||
UNUSED(session);
|
||||
|
||||
|
|
@ -2154,7 +2154,7 @@ static int ftpd_listbuffer(FAR struct ftpd_session_s *session,
|
|||
|
||||
name = basename(path);
|
||||
|
||||
if ((opton & FTPD_LISTOPTION_L) != 0)
|
||||
if ((option & FTPD_LISTOPTION_L) != 0)
|
||||
{
|
||||
FAR const char *str;
|
||||
struct tm tm;
|
||||
|
|
@ -2367,7 +2367,7 @@ static int ftpd_listbuffer(FAR struct ftpd_session_s *session,
|
|||
****************************************************************************/
|
||||
|
||||
static int fptd_listscan(FAR struct ftpd_session_s *session, FAR char *path,
|
||||
unsigned int opton)
|
||||
unsigned int option)
|
||||
{
|
||||
FAR char *temp;
|
||||
DIR *dir;
|
||||
|
|
@ -2384,7 +2384,7 @@ static int fptd_listscan(FAR struct ftpd_session_s *session, FAR char *path,
|
|||
if (!S_ISDIR(st.st_mode))
|
||||
{
|
||||
ret = ftpd_listbuffer(session, path, &st, session->data.buffer,
|
||||
session->data.buflen, opton);
|
||||
session->data.buflen, option);
|
||||
if (ret == 0)
|
||||
{
|
||||
ret = ftpd_response(session->data.sd, session->txtimeout,
|
||||
|
|
@ -2412,7 +2412,7 @@ static int fptd_listscan(FAR struct ftpd_session_s *session, FAR char *path,
|
|||
|
||||
if (entry->d_name[0] == '.')
|
||||
{
|
||||
if ((opton & FTPD_LISTOPTION_A) == 0)
|
||||
if ((option & FTPD_LISTOPTION_A) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -2432,7 +2432,7 @@ static int fptd_listscan(FAR struct ftpd_session_s *session, FAR char *path,
|
|||
}
|
||||
|
||||
ret = ftpd_listbuffer(session, temp, &st, session->data.buffer,
|
||||
session->data.buflen, opton);
|
||||
session->data.buflen, option);
|
||||
if (ret >= 0)
|
||||
{
|
||||
ret = ftpd_response(session->data.sd, session->txtimeout,
|
||||
|
|
@ -2454,7 +2454,7 @@ static int fptd_listscan(FAR struct ftpd_session_s *session, FAR char *path,
|
|||
* Name: ftpd_list
|
||||
****************************************************************************/
|
||||
|
||||
static int ftpd_list(FAR struct ftpd_session_s *session, unsigned int opton)
|
||||
static int ftpd_list(FAR struct ftpd_session_s *session, unsigned int option)
|
||||
{
|
||||
FAR char *abspath;
|
||||
int ret;
|
||||
|
|
@ -2462,7 +2462,7 @@ static int ftpd_list(FAR struct ftpd_session_s *session, unsigned int opton)
|
|||
ret = ftpd_getpath(session, session->param, &abspath, NULL);
|
||||
if (ret >= 0)
|
||||
{
|
||||
ret = fptd_listscan(session, abspath, opton);
|
||||
ret = fptd_listscan(session, abspath, option);
|
||||
free(abspath);
|
||||
}
|
||||
|
||||
|
|
@ -3417,7 +3417,7 @@ static int ftpd_command_epsv(FAR struct ftpd_session_s *session)
|
|||
|
||||
static int ftpd_command_list(FAR struct ftpd_session_s *session)
|
||||
{
|
||||
uint8_t opton = FTPD_LISTOPTION_L;
|
||||
uint8_t option = FTPD_LISTOPTION_L;
|
||||
int ret;
|
||||
|
||||
ret = ftpd_dataopen(session);
|
||||
|
|
@ -3435,8 +3435,8 @@ static int ftpd_command_list(FAR struct ftpd_session_s *session)
|
|||
return ret;
|
||||
}
|
||||
|
||||
opton |= ftpd_listoption((char **)(&session->param));
|
||||
ftpd_list(session, opton);
|
||||
option |= ftpd_listoption((char **)(&session->param));
|
||||
ftpd_list(session, option);
|
||||
|
||||
ret = ftpd_response(session->cmd.sd, session->txtimeout,
|
||||
g_respfmt1, 226, ' ', "Transfer complete");
|
||||
|
|
@ -3451,7 +3451,7 @@ static int ftpd_command_list(FAR struct ftpd_session_s *session)
|
|||
|
||||
static int ftpd_command_nlst(FAR struct ftpd_session_s *session)
|
||||
{
|
||||
uint8_t opton = 0;
|
||||
uint8_t option = 0;
|
||||
int ret;
|
||||
|
||||
ret = ftpd_dataopen(session);
|
||||
|
|
@ -3469,8 +3469,8 @@ static int ftpd_command_nlst(FAR struct ftpd_session_s *session)
|
|||
return ret;
|
||||
}
|
||||
|
||||
opton |= ftpd_listoption((char **)(&session->param));
|
||||
ftpd_list(session, opton);
|
||||
option |= ftpd_listoption((char **)(&session->param));
|
||||
ftpd_list(session, option);
|
||||
|
||||
ret = ftpd_response(session->cmd.sd, session->txtimeout,
|
||||
g_respfmt1, 226, ' ', "Transfer complete");
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static FAR void *doit(pthread_addr_t pvarg)
|
|||
char buf[REXECD_BUFSIZE];
|
||||
struct pollfd fds[2];
|
||||
FAR FILE *fp;
|
||||
int sock = (int)pvarg;
|
||||
int sock = (long)pvarg;
|
||||
int ret;
|
||||
|
||||
/* we need to read err_sock, user and passwd, but ignore them */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue