summaryrefslogtreecommitdiff
path: root/source3/libsmb/clilist.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-02 19:22:22 +0200
committerVolker Lendecke <vl@samba.org>2010-08-04 20:32:50 +0200
commit867626abcad88b84684e9d328abf51d4f410a1cb (patch)
treea15ee1aefc33c3c1278e8ab955dcb8db38ab5463 /source3/libsmb/clilist.c
parent2ff73f0df3257c27cb3cdae779e679de3170be17 (diff)
downloadsamba-867626abcad88b84684e9d328abf51d4f410a1cb.tar.gz
s3: Convert cli_list() to return NTSTATUS
If needed, the callback functions can count themselves
Diffstat (limited to 'source3/libsmb/clilist.c')
-rw-r--r--source3/libsmb/clilist.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 99dcc3f9c6c..a8e3bd50179 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -677,11 +677,19 @@ int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
This auto-switches between old and new style.
****************************************************************************/
-int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, struct file_info *, const char *,
- void *), void *state)
+NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
+ void (*fn)(const char *, struct file_info *, const char *,
+ void *), void *state)
{
- if (cli->protocol <= PROTOCOL_LANMAN1)
- return cli_list_old(cli, Mask, attribute, fn, state);
- return cli_list_new(cli, Mask, attribute, fn, state);
+ int rec;
+
+ if (cli->protocol <= PROTOCOL_LANMAN1) {
+ rec = cli_list_old(cli, Mask, attribute, fn, state);
+ } else {
+ rec = cli_list_new(cli, Mask, attribute, fn, state);
+ }
+ if (rec == -1) {
+ return cli_nt_error(cli);
+ }
+ return NT_STATUS_OK;
}