Merge:
authorTim Potter <tpot@samba.org>
Mon, 28 Apr 2003 05:54:37 +0000 (05:54 +0000)
committerTim Potter <tpot@samba.org>
Mon, 28 Apr 2003 05:54:37 +0000 (05:54 +0000)
>Patch from waider to set exit code of last executed command specified
>as an argument to -c.

source/rpcclient/rpcclient.c

index bf016e94c7c69cfe0db33d56e4ba148241f88a0e..0411212e8c8a7ebdad2d6bf4cb6fb477277b675d 100644 (file)
@@ -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 */