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:
hongfengchen 2025-06-10 15:00:26 +08:00 committed by Xiang Xiao
parent 34e4d7eacd
commit c69df55cd0
3 changed files with 20 additions and 20 deletions

View file

@ -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");

View file

@ -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 */

View file

@ -122,7 +122,7 @@ static void show_usage(FAR const char *progname)
{
printf("\nUsage: %s -m [max allocsize Default:8192] "
"-n [node length Default:1024] -t [sleep us Default:100]"
" -x [nthreads Default:1] -d [debuger mode]\n",
" -x [nthreads Default:1] -d [debugger mode]\n",
progname);
printf("\nWhere:\n");
printf(" -m [max-allocsize] max alloc size.\n");
@ -217,7 +217,7 @@ static void checknode(FAR struct memorystress_thread_context_s *context,
context->error.rwerror = rwerror;
error_result(context->error);
lib_dumpbuffer("debuger", node->buf, size);
lib_dumpbuffer("debugger", node->buf, size);
/* Trigger the ASSET once it occurs, retaining the error site */