summaryrefslogtreecommitdiffstats
path: root/qarshd.c
diff options
context:
space:
mode:
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);