void nbd_client_close(NBDClient *client)

{

    if (client->closing) {

        return;

    }



    client->closing = true;



    /* Force requests to finish.  They will drop their own references,

     * then we'll close the socket and free the NBDClient.

     */

    shutdown(client->sock, 2);



    /* Also tell the client, so that they release their reference.  */

    if (client->close) {

        client->close(client);

    }

}

void nbd_client_close(NBDClient *client)

{

    if (client->closing) {

        return;

    }



    client->closing = true;



    





    shutdown(client->sock, 2);



    

    if (client->close) {

        client->close(client);

    }

}

void FUNC_0(NBDClient *VAR_0)

{

    if (VAR_0->closing) {

        return;

    }



    VAR_0->closing = true;



    





    shutdown(VAR_0->sock, 2);



    

    if (VAR_0->close) {

        VAR_0->close(VAR_0);

    }

}

void FUNC_0(NBDClient *VAR_0)
{ if (VAR_0->closing) { return; } VAR_0->closing = true; shutdown(VAR_0->sock, 2); if (VAR_0->close) { VAR_0->close(VAR_0); } }