summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-25 13:20:56 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-29 18:11:15 +0200
commitd7bf30ef92031ffddcde3680b38e602510bcae24 (patch)
tree3f30c38c489949b994c3b36ba94ec00d803edda7 /source3/libsmb
parent47e10ab9a85960c78af807b66b99bcd139713644 (diff)
downloadsamba-d7bf30ef92031ffddcde3680b38e602510bcae24.tar.gz
samba-d7bf30ef92031ffddcde3680b38e602510bcae24.tar.bz2
samba-d7bf30ef92031ffddcde3680b38e602510bcae24.zip
s3:libsmb: add cli_state_is_connected() function
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clierror.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c
index 54f8a7a43c..015afb18aa 100644
--- a/source3/libsmb/clierror.c
+++ b/source3/libsmb/clierror.c
@@ -359,3 +359,21 @@ void cli_reset_error(struct cli_state *cli)
SSVAL(cli->inbuf,smb_err,0);
}
}
+
+bool cli_state_is_connected(struct cli_state *cli)
+{
+ if (cli == NULL) {
+ return false;
+ }
+
+ if (!cli->initialised) {
+ return false;
+ }
+
+ if (cli->fd == -1) {
+ return false;
+ }
+
+ return true;
+}
+