mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
No longer leak file descriptors in mysql_close. Fixes Bug#15846.
vio/viosocket.c: ORs were wrong to begin with, but more importantly, we mustn't use shortable-circuit logic. Also newly reap the connection-closed event handle.
This commit is contained in:
@@ -560,14 +560,20 @@ int vio_close_shared_memory(Vio * vio)
|
|||||||
Close all handlers. UnmapViewOfFile and CloseHandle return non-zero
|
Close all handlers. UnmapViewOfFile and CloseHandle return non-zero
|
||||||
result if they are success.
|
result if they are success.
|
||||||
*/
|
*/
|
||||||
r= UnmapViewOfFile(vio->handle_map) || CloseHandle(vio->event_server_wrote) ||
|
if (UnmapViewOfFile(vio->handle_map) == 0)
|
||||||
CloseHandle(vio->event_server_read) || CloseHandle(vio->event_client_wrote) ||
|
DBUG_PRINT("vio_error", ("UnmapViewOfFile() failed"));
|
||||||
CloseHandle(vio->event_client_read) || CloseHandle(vio->handle_file_map);
|
if (CloseHandle(vio->event_server_wrote) == 0)
|
||||||
if (!r)
|
DBUG_PRINT("vio_error", ("CloseHandle(vio->esw) failed"));
|
||||||
{
|
if (CloseHandle(vio->event_server_read) == 0)
|
||||||
DBUG_PRINT("vio_error", ("close() failed, error: %d",r));
|
DBUG_PRINT("vio_error", ("CloseHandle(vio->esr) failed"));
|
||||||
/* FIXME: error handling (not critical for MySQL) */
|
if (CloseHandle(vio->event_client_wrote) == 0)
|
||||||
}
|
DBUG_PRINT("vio_error", ("CloseHandle(vio->ecw) failed"));
|
||||||
|
if (CloseHandle(vio->event_client_read) == 0)
|
||||||
|
DBUG_PRINT("vio_error", ("CloseHandle(vio->ecr) failed"));
|
||||||
|
if (CloseHandle(vio->handle_file_map) == 0)
|
||||||
|
DBUG_PRINT("vio_error", ("CloseHandle(vio->hfm) failed"));
|
||||||
|
if (CloseHandle(vio->event_conn_closed) == 0)
|
||||||
|
DBUG_PRINT("vio_error", ("CloseHandle(vio->ecc) failed"));
|
||||||
}
|
}
|
||||||
vio->type= VIO_CLOSED;
|
vio->type= VIO_CLOSED;
|
||||||
vio->sd= -1;
|
vio->sd= -1;
|
||||||
|
Reference in New Issue
Block a user