From 7e009a02a2e6ea9ba113079cb97f1599fc2a19b0 Mon Sep 17 00:00:00 2001 From: wangbo Date: Fri, 22 Sep 2023 07:42:24 +0000 Subject: [PATCH] =?UTF-8?q?FIX|=20=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README | 3 ++- app/include/cmd.h | 2 -- app/lib/a_process/process.c | 6 +++--- app/lib/m_management/cmd.c | 14 +------------- 4 files changed, 6 insertions(+), 19 deletions(-) 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()