summaryrefslogtreecommitdiffstats
path: root/qarshd.c
diff options
context:
space:
mode:
authorNate Straz <nstraz@redhat.com>2008-07-01 18:33:12 +0000
committerNathan Straz <nstraz@redhat.com>2008-09-23 09:37:47 -0400
commitd4de6a0d2339ac022d510d0ce2d629dc0a954a55 (patch)
tree7e9d82a8c732996abe9f8b5556d4afdd304f76a3 /qarshd.c
parent055c473f917703e7e73581a915e770f595dd76b4 (diff)
downloadqarsh-d4de6a0d2339ac022d510d0ce2d629dc0a954a55.tar.gz
qarsh-d4de6a0d2339ac022d510d0ce2d629dc0a954a55.tar.xz
qarsh-d4de6a0d2339ac022d510d0ce2d629dc0a954a55.zip
Don't print out the debug syslog messages unless you also use the -d option.
For those that can't configure syslog properly while debugging other things.
Diffstat (limited to 'qarshd.c')
-rw-r--r--qarshd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/qarshd.c b/qarshd.c
index 8cca3b5..852d76e 100644
--- a/qarshd.c
+++ b/qarshd.c
@@ -44,6 +44,8 @@
* QA Remote Shell Daemon
*/
+int debug = 0;
+
/* Globals */
struct sockaddr_in peername;
@@ -273,7 +275,7 @@ handle_packets(int infd)
} else if (nfd > 0) {
qp = recv_packet(infd);
if (qp == NULL) {
- syslog(LOG_DEBUG, "That's enough\n");
+ if (debug) syslog(LOG_DEBUG, "That's enough\n");
break;
}
dump_qp(qp);
@@ -355,7 +357,7 @@ handle_packets(int infd)
qp_packet_type(qp->qp_type));
}
} else {
- syslog(LOG_DEBUG, "Nothing to do\n");
+ if (debug) syslog(LOG_DEBUG, "Nothing to do\n");
}
}
@@ -369,8 +371,11 @@ main(int argc, char *argv[])
openlog("qarshd", LOG_PID, LOG_DAEMON);
- while ((ch = getopt(argc, argv, "")) != -1) {
+ while ((ch = getopt(argc, argv, "d")) != -1) {
switch (ch) {
+ case 'd':
+ debug = 1;
+ break;
case '?':
default:
printf("unknown option '%c'\n", optopt);