mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
os: fix FlushClient
Flushclient implicitly cast the result from a write-like call to size_t, which turned it's error return value, -1, into a large positive value, breaking the surrounding error-checking code. Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
committed by
Enrico Weigelt
parent
fe186eee6f
commit
909a5462ac
2
os/io.c
2
os/io.c
@@ -916,7 +916,7 @@ FlushClient(ClientPtr who, OsCommPtr oc)
|
||||
size_t todo = notWritten; /* trying to write that much this time */
|
||||
while (notWritten) {
|
||||
errno = 0;
|
||||
size_t len = _XSERVTransWrite(trans_conn, (const char*)oco->buf + written, todo);
|
||||
ssize_t len = _XSERVTransWrite(trans_conn, ((const char*)oco->buf) + written, todo);
|
||||
if (len >= 0) {
|
||||
written += len;
|
||||
notWritten -= len;
|
||||
|
||||
Reference in New Issue
Block a user