goto done;
}
- if (cli->fd == -1 && NT_STATUS_IS_OK(cli->raw_status)) {
+ if (!cli_state_is_connected(cli) && NT_STATUS_IS_OK(cli->raw_status)) {
return nt_errstr(NT_STATUS_CONNECTION_DISCONNECTED);
}
NTSTATUS cli_nt_error(struct cli_state *cli)
{
/* Deal with socket errors first. */
- if (cli->fd == -1) {
+ if (!cli_state_is_connected(cli)) {
return NT_STATUS_CONNECTION_DISCONNECTED;
}
void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode)
{
- if(!cli->initialised) {
- return;
- }
-
- if (cli->fd == -1) {
+ if (!cli_state_is_connected(cli)) {
*eclass = ERRDOS;
*ecode = ERRnotconnected;
return;
bool cli_is_error(struct cli_state *cli)
{
/* A socket error is always an error. */
- if (cli->fd == -1) {
- return True;
+ if (!cli_state_is_connected(cli)) {
+ return true;
}
if (NT_STATUS_IS_DOS(cli->raw_status)) {
bool cli_is_nt_error(struct cli_state *cli)
{
/* A socket error is always an NT error. */
- if (cli->fd == -1) {
- return True;
+ if (!cli_state_is_connected(cli)) {
+ return true;
}
return cli_is_error(cli) && !NT_STATUS_IS_DOS(cli->raw_status);
bool cli_is_dos_error(struct cli_state *cli)
{
/* A socket error is always a DOS error. */
- if (cli->fd == -1) {
- return True;
+ if (!cli_state_is_connected(cli)) {
+ return true;
}
return cli_is_error(cli) && NT_STATUS_IS_DOS(cli->raw_status);