diff options
author | Bill Nottingham <notting@redhat.com> | 1999-03-18 01:01:45 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 1999-03-18 01:01:45 +0000 |
commit | 54d96728833eabc23f4203ee7d2c834621f6b873 (patch) | |
tree | ea968aec4460ebbc381b3ae0f58c931ef514a611 /src/initlog.c | |
parent | 6aac6bb6c8ceea467a12dc5a6810d73cf516a445 (diff) | |
download | initscripts-54d96728833eabc23f4203ee7d2c834621f6b873.tar initscripts-54d96728833eabc23f4203ee7d2c834621f6b873.tar.gz initscripts-54d96728833eabc23f4203ee7d2c834621f6b873.tar.bz2 initscripts-54d96728833eabc23f4203ee7d2c834621f6b873.tar.xz initscripts-54d96728833eabc23f4203ee7d2c834621f6b873.zip |
don't output error messages if reading commands
Diffstat (limited to 'src/initlog.c')
-rw-r--r-- | src/initlog.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/initlog.c b/src/initlog.c index 4788c8fa..6e6e4385 100644 --- a/src/initlog.c +++ b/src/initlog.c @@ -189,7 +189,7 @@ int logString(char *cmd, char *string) { return logLine(&logentry); } -int processArgs(int argc, char **argv) { +int processArgs(int argc, char **argv, int silent) { char *cmdname=NULL; int cmdevent=0; char *cmd=NULL; @@ -267,18 +267,21 @@ int processArgs(int argc, char **argv) { } if ((rc < -1)) { - fprintf(stderr, "%s: %s\n", + if (!silent) + fprintf(stderr, "%s: %s\n", poptBadOption(context, POPT_BADOPTION_NOALIAS), poptStrerror(rc)); return -1; } if ( (cmd && logstring) || (cmd && cmdname) ) { - fprintf(stderr, _("--cmd and --run are incompatible with --string or --name\n")); + if (!silent) + fprintf(stderr, _("--cmd and --run are incompatible with --string or --name\n")); return -1; } if ( cmdname && (!logstring && !cmdevent)) { - fprintf(stderr, _("--name requires one of --event or --string\n")); + if (!silent) + fprintf(stderr, _("--name requires one of --event or --string\n")); return -1; } if (cmdevent) { @@ -288,7 +291,8 @@ int processArgs(int argc, char **argv) { } else if ( cmd ) { return(runCommand(cmd,reexec,quiet)); } else { - fprintf(stderr,"nothing to do!\n"); + if (!silent) + fprintf(stderr,"nothing to do!\n"); return -1; } return 0; @@ -299,5 +303,5 @@ int main(int argc, char **argv) { setlocale(LC_ALL,""); bindtextdomain("initlog","/etc/locale"); textdomain("initlog"); - exit(processArgs(argc,argv)); + exit(processArgs(argc,argv,0)); } |