From 7bba81f69dec444a7adb16bed5bba921e483c7b2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 11 Jul 2011 14:33:54 +0200 Subject: [PATCH] s3:libsmb: add cli_state_disconnect() metze --- source3/libsmb/clierror.c | 7 +++++++ source3/libsmb/proto.h | 1 + 2 files changed, 8 insertions(+) diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c index 52f4c03fe5d..92c2cc28154 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 abb201a6194..66ab6e6b157 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 */ -- 2.11.4.GIT