From 1fe7ec8b4bf8141ab5778215e43a3ca19e04d7b9 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 23 Apr 2003 07:10:28 +0000 Subject: Patch from waider to set exit code of last executed command specified as an argument to -c. (This used to be commit 048aeefcdc12d93bc728d104bbf38ea8becfb16c) --- source3/rpcclient/rpcclient.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index bf016e94c7..0411212e8c 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -628,13 +628,15 @@ out_free: if (cmdstr && cmdstr[0]) { char *cmd; char *p = cmdstr; + int result = 0; while((cmd=next_command(&p)) != NULL) { - process_cmd(cli, cmd); + NTSTATUS cmd_result = process_cmd(cli, cmd); + result = NT_STATUS_IS_ERR(cmd_result); } cli_shutdown(cli); - return 0; + return result; } /* Loop around accepting commands */ -- cgit