Skip to content

Commit 49f7a31

Browse files
committed
if write has already been accepted - process it
1 parent 5a70acb commit 49f7a31

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/io/cchar/uzdat.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,13 @@ static void uzdat_on_async_write(uv_async_t *handle)
163163

164164
pthread_mutex_lock(&uzdat->mutex);
165165
char data = uzdat->buf_wr;
166-
int dir = uzdat->dir;
167166
pthread_mutex_unlock(&uzdat->mutex);
168167

169-
if (dir == UZDAT_DIR_OUT) {
170-
int res = uzdat->terminal->write(uzdat->terminal, data);
171-
if (res == 0) {
172-
LOGCHAR(L_UZDAT, "%s: ", "Written to terminal", data)
173-
} else {
174-
LOGCHAR(L_UZDAT, "%s: ", "Failed write to terminal", data)
175-
}
168+
int res = uzdat->terminal->write(uzdat->terminal, data);
169+
if (res == 0) {
170+
LOGCHAR(L_UZDAT, "%s: ", "Written to terminal", data)
176171
} else {
177-
LOGCHAR(L_UZDAT, "%s: ", "Not in sending mode, ignored", data)
172+
LOGCHAR(L_UZDAT, "%s: ", "Failed write to terminal", data)
178173
}
179174
}
180175

0 commit comments

Comments
 (0)