os: io: FlushClient() consolidate error/abort code path

remove some redundancy in the error path

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-07 11:42:43 +02:00
committed by Enrico Weigelt
parent be7784fce2
commit fdf43d4176

16
os/io.c
View File

@@ -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