FIX| 去掉无用代码;

master
wangbo 2 years ago
parent f9066d94a9
commit 7e009a02a2

@ -1,3 +1,4 @@
操作方法: 操作方法:
cd build cd build
make sshcmd make sshcmd

@ -294,8 +294,6 @@ typedef struct
vtycmd_head_t buf_read; vtycmd_head_t buf_read;
vtycmd_head_t buf_write; vtycmd_head_t buf_write;
int socket; int socket;
pthread_mutex_t wr_mutex; /* buf of mutex*/
pthread_mutex_t rd_mutex; /* buf of mutex*/
} vtycmd_t; } vtycmd_t;

@ -72,7 +72,7 @@ uint16_t version_hex;
uint32_t start_time; uint32_t start_time;
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
extern void vtycmd_init();
/* Internal functions --------------------------------------------------------*/ /* Internal functions --------------------------------------------------------*/
/* 信号处理函数 */ /* 信号处理函数 */
void _signal_handler(int sig) void _signal_handler(int sig)
@ -201,8 +201,8 @@ int32_t main(int32_t argc, char **argv)
is_system_init = TRUE; is_system_init = TRUE;
start_time = time(NULL); start_time = time(NULL);
//GPIO_ERR1_LED(1); //GPIO_ERR1_LED(1);
/* 启动ssh命令行 */ /* 启动ssh命令行 */
vtycmd_init(); vtycmd_init();
/* 主循环, 点灯喂狗. */ /* 主循环, 点灯喂狗. */

@ -3180,7 +3180,7 @@ int create_client_socket()
// exit(1); // exit(1);
//} //}
printf("[%s %d] Connect pass! %d\n",__FILE__,__LINE__,sockfd); printh("[%s %d] Connect pass! %d\n",__FILE__,__LINE__,sockfd);
return sockfd; return sockfd;
} }
@ -3219,18 +3219,6 @@ void vtycmd_data_init()
vtycmd->socket = -1; vtycmd->socket = -1;
memset(&vtycmd->buf_read, 0, sizeof(vtycmd_head_t)); memset(&vtycmd->buf_read, 0, sizeof(vtycmd_head_t));
memset(&vtycmd->buf_write, 0, sizeof(vtycmd_head_t)); memset(&vtycmd->buf_write, 0, sizeof(vtycmd_head_t));
if (pthread_mutex_init(&vtycmd->wr_mutex, NULL) != 0)
{
log_err(LOG_DEFAULT, "ERROR at mutex init return %s!", safe_strerror(errno));
return;
}
if (pthread_mutex_init(&vtycmd->rd_mutex, NULL) != 0)
{
log_err(LOG_DEFAULT, "ERROR at mutex init return %s!", safe_strerror(errno));
return;
}
} }
void vtycmd_init() void vtycmd_init()

Loading…
Cancel
Save