diff options
author | Gerald Carter <jerry@samba.org> | 2002-06-17 18:36:36 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-06-17 18:36:36 +0000 |
commit | 1e6e5b299c235b513095a76a4cd9fffc41e8fc9c (patch) | |
tree | 9f741529073ad411cc7328334e26d3e35b1d33f1 /source/utils/smbcontrol.c | |
parent | a11c5d7ad07d259d764aede4745d13f8163a8212 (diff) | |
download | samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.tar.gz samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.tar.xz samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.zip |
beginning to sync up for 2.2.5 release....
Diffstat (limited to 'source/utils/smbcontrol.c')
-rw-r--r-- | source/utils/smbcontrol.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/utils/smbcontrol.c b/source/utils/smbcontrol.c index 102fdbb19e7..7bb5c3e2c8b 100644 --- a/source/utils/smbcontrol.c +++ b/source/utils/smbcontrol.c @@ -46,8 +46,8 @@ static void usage(BOOL doexit) { int i; if (doexit) { - printf("Usage: smbcontrol -i -s configfile\n"); - printf(" smbcontrol <destination> <message-type> <parameters>\n\n"); + printf("Usage: smbcontrol [-d debuglevel] [-s configfile] [-i]\n"); + printf(" smbcontrol [-d debuglevel] [-s configfile] <destination> <message-type> <parameters>\n\n"); } else { printf("<destination> <message-type> <parameters>\n\n"); } @@ -344,6 +344,7 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params) { int opt; char temp[255]; + extern char *optarg; extern int optind; pstring servicesf = CONFIGFILE; BOOL interactive = False; @@ -357,8 +358,11 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params) if (argc < 2) usage(True); - while ((opt = getopt(argc, argv,"is:")) != EOF) { + while ((opt = getopt(argc, argv,"is:d:")) != EOF) { switch (opt) { + case 'd': + DEBUGLEVEL = atoi(optarg); + break; case 'i': interactive = True; break; @@ -380,7 +384,11 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params) if (!interactive) { if (argc < 2) usage(True); - return (do_command(argv[0],argv[1], argc-2, argc > 2 ? &argv[2] : 0)); + /* + * We want to return !do_command so we get the + * right shell semantics (0 = success, 1 = fail) + */ + return (!do_command(argv[0],argv[1], argc-2, argc > 2 ? &argv[2] : 0)); } while (True) { |