From fdf43d41765875882d78c16d9390b2d8a1d06c20 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 7 Aug 2025 11:42:43 +0200 Subject: [PATCH] os: io: FlushClient() consolidate error/abort code path remove some redundancy in the error path Signed-off-by: Enrico Weigelt, metux IT consult --- os/io.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/os/io.c b/os/io.c index 18cad3a47..ae6b01be1 100644 --- a/os/io.c +++ b/os/io.c @@ -880,10 +880,7 @@ FlushClient(ClientPtr who, OsCommPtr oc) if (!trans_conn) { /* uh, transport not connected ? can only kill the client :( */ - AbortClient(who); - dixMarkClientException(who); - oco->count = 0; - return -1; + goto abortClient; } size_t written = 0; @@ -940,10 +937,7 @@ FlushClient(ClientPtr who, OsCommPtr oc) } #endif else { - AbortClient(who); - dixMarkClientException(who); - oco->count = 0; - return -1; + goto abortClient; } } @@ -961,6 +955,12 @@ FlushClient(ClientPtr who, OsCommPtr oc) } oc->output = (ConnectionOutputPtr) NULL; return 0; /* return only the amount explicitly requested */ + +abortClient: + AbortClient(who); + dixMarkClientException(who); + oco->count = 0; + return -1; } static ConnectionInputPtr