diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-07-11 14:33:54 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-11 18:18:26 +0200 |
commit | 7bba81f69dec444a7adb16bed5bba921e483c7b2 (patch) | |
tree | be7e4724db678c385ca39e28f725c073654afac7 /source3 | |
parent | fa60a299f5621ca06b25e64d552a85f846d7f0f2 (diff) | |
download | samba-7bba81f69dec444a7adb16bed5bba921e483c7b2.tar.gz samba-7bba81f69dec444a7adb16bed5bba921e483c7b2.tar.bz2 samba-7bba81f69dec444a7adb16bed5bba921e483c7b2.zip |
s3:libsmb: add cli_state_disconnect()
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/clierror.c | 7 | ||||
-rw-r--r-- | source3/libsmb/proto.h | 1 |
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 */ |