diff --git a/README b/README index 27d9601..262c1b8 100755 --- a/README +++ b/README @@ -1,3 +1,4 @@ 操作方法: cd build -make sshcmd \ No newline at end of file +make sshcmd + diff --git a/app/include/cmd.h b/app/include/cmd.h index 0b01c7f..4e5e524 100755 --- a/app/include/cmd.h +++ b/app/include/cmd.h @@ -294,8 +294,6 @@ typedef struct vtycmd_head_t buf_read; vtycmd_head_t buf_write; int socket; - pthread_mutex_t wr_mutex; /* buf of mutex*/ - pthread_mutex_t rd_mutex; /* buf of mutex*/ } vtycmd_t; diff --git a/app/lib/a_process/process.c b/app/lib/a_process/process.c index edfd6dc..e141c47 100755 --- a/app/lib/a_process/process.c +++ b/app/lib/a_process/process.c @@ -72,7 +72,7 @@ uint16_t version_hex; uint32_t start_time; /* Private function prototypes -----------------------------------------------*/ - +extern void vtycmd_init(); /* Internal functions --------------------------------------------------------*/ /* 信号处理函数 */ void _signal_handler(int sig) @@ -201,8 +201,8 @@ int32_t main(int32_t argc, char **argv) is_system_init = TRUE; start_time = time(NULL); //GPIO_ERR1_LED(1); - - /* 启动ssh命令行 */ + + /* 启动ssh命令行 */ vtycmd_init(); /* 主循环, 点灯喂狗. */ diff --git a/app/lib/m_management/cmd.c b/app/lib/m_management/cmd.c index 4add722..4745c3d 100755 --- a/app/lib/m_management/cmd.c +++ b/app/lib/m_management/cmd.c @@ -3180,7 +3180,7 @@ int create_client_socket() // exit(1); //} - printf("[%s %d] Connect pass! %d\n",__FILE__,__LINE__,sockfd); + printh("[%s %d] Connect pass! %d\n",__FILE__,__LINE__,sockfd); return sockfd; } @@ -3219,18 +3219,6 @@ void vtycmd_data_init() vtycmd->socket = -1; memset(&vtycmd->buf_read, 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()