From 867626abcad88b84684e9d328abf51d4f410a1cb Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 2 Aug 2010 19:22:22 +0200 Subject: s3: Convert cli_list() to return NTSTATUS If needed, the callback functions can count themselves --- source3/libsmb/clilist.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source3/libsmb/clilist.c') diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 99dcc3f9c6..a8e3bd5017 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; } -- cgit