summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/clierror.c7
-rw-r--r--source3/libsmb/proto.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c
index 52f4c03fe5..92c2cc2815 100644
--- a/source3/libsmb/clierror.c
+++ b/source3/libsmb/clierror.c
@@ -194,3 +194,10 @@ bool cli_state_is_connected(struct cli_state *cli)
return true;
}
+void cli_state_disconnect(struct cli_state *cli)
+{
+ if (cli->fd != -1) {
+ close(cli->fd);
+ }
+ cli->fd = -1;
+}
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index abb201a619..66ab6e6b15 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -191,6 +191,7 @@ bool cli_is_error(struct cli_state *cli);
bool cli_is_nt_error(struct cli_state *cli);
bool cli_is_dos_error(struct cli_state *cli);
bool cli_state_is_connected(struct cli_state *cli);
+void cli_state_disconnect(struct cli_state *cli);
/* The following definitions come from libsmb/clifile.c */