mirror of
https://github.com/eddyem/small_tel.git
synced 2026-05-01 18:37:07 +03:00
fixed bug
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user