summaryrefslogtreecommitdiff
path: root/usr.sbin/iscsid/iscsid.c
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2011-08-20 19:03:40 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2011-08-20 19:03:40 +0000
commit9c3ef0d88afe19d6cfccd3ca29d65d8cc0df4764 (patch)
tree55b47da8165b4cb2daba650230fbb847720fba3d /usr.sbin/iscsid/iscsid.c
parentabb7f3e568a613a7d6daf6af3556386e08bfee52 (diff)
Add support for -v (enable verbose logging on the command line).
Previously only available via iscsictl. ok claudio@
Diffstat (limited to 'usr.sbin/iscsid/iscsid.c')
-rw-r--r--usr.sbin/iscsid/iscsid.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/iscsid/iscsid.c b/usr.sbin/iscsid/iscsid.c
index 28dc39c6d25..3a0112c3a50 100644
--- a/usr.sbin/iscsid/iscsid.c
+++ b/usr.sbin/iscsid/iscsid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iscsid.c,v 1.7 2011/05/04 21:00:04 claudio Exp $ */
+/* $OpenBSD: iscsid.c,v 1.8 2011/08/20 19:03:39 sthen Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -68,11 +68,12 @@ main(int argc, char *argv[])
struct passwd *pw;
char *ctrlsock = ISCSID_CONTROL;
char *vscsidev = ISCSID_DEVICE;
- int ch, debug = 0;
+ int ch, debug = 0, verbose = 0;
log_init(1); /* log to stderr until daemonized */
+ log_verbose(1);
- while ((ch = getopt(argc, argv, "dn:s:")) != -1) {
+ while ((ch = getopt(argc, argv, "dn:s:v")) != -1) {
switch (ch) {
case 'd':
debug = 1;
@@ -83,6 +84,9 @@ main(int argc, char *argv[])
case 's':
ctrlsock = optarg;
break;
+ case 'v':
+ verbose = 1;
+ break;
default:
usage();
/* NOTREACHED */
@@ -100,6 +104,8 @@ main(int argc, char *argv[])
errx(1, "need root privileges");
log_init(debug);
+ log_verbose(verbose);
+
if (!debug)
daemon(1, 0);
log_info("startup");
@@ -173,7 +179,7 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-d] [-n device] [-s socket]\n",
+ fprintf(stderr, "usage: %s [-dv] [-n device] [-s socket]\n",
__progname);
exit(1);
}