fixed bug

This commit is contained in:
2026-04-02 12:00:43 +03:00
parent a324302404
commit 9d58bf1694
3 changed files with 12 additions and 3 deletions

View File

@@ -113,6 +113,10 @@ static char *read_string(){
*/
static char *write_cmd(const char *cmd, char *buff){
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
if(!TTY || TTY->comfd < 0){
DBG("TTY destroyed");
return NULL;
}
pthread_mutex_lock(&mutex);
DBG("Write %s", cmd);
if(sl_tty_write(TTY->comfd, cmd, strlen(cmd))) return NULL;