From: matt mooney <mfm@muteddisk.com>
To: Greg KH <greg@kroah.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 06/22] staging: usbip: userspace: usbip.c: add log option
Date: Sun, 19 Jun 2011 22:44:36 -0700 [thread overview]
Message-ID: <8a6d045c9214a4af84e7a3f186abe3e7af3fd3d4.1308547654.git.mfm@muteddisk.com> (raw)
In-Reply-To: <cover.1308547654.git.mfm@muteddisk.com>
Add option for logging with syslog, and default to use stderr for
error and info messages.
Signed-off-by: matt mooney <mfm@muteddisk.com>
---
drivers/staging/usbip/userspace/src/usbip.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/usbip/userspace/src/usbip.c b/drivers/staging/usbip/userspace/src/usbip.c
index 8940cd0..cdfe4c2 100644
--- a/drivers/staging/usbip/userspace/src/usbip.c
+++ b/drivers/staging/usbip/userspace/src/usbip.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <getopt.h>
+#include <syslog.h>
#include "usbip_common.h"
#include "usbip.h"
@@ -33,7 +34,7 @@ static int usbip_version(int argc, char *argv[]);
static const char usbip_version_string[] = PACKAGE_STRING;
static const char usbip_usage_string[] =
- "usbip [--debug] [version]\n"
+ "usbip [--debug] [--log] [version]\n"
" [help] <command> <args>\n";
static void usbip_usage(void)
@@ -138,12 +139,15 @@ int main(int argc, char *argv[])
{
static const struct option opts[] = {
{ "debug", no_argument, NULL, 'd' },
- { NULL, 0, NULL, 0 }
+ { "log", no_argument, NULL, 'l' },
+ { NULL, 0, NULL, 0 }
};
+
char *cmd;
int opt;
int i, rc = -1;
+ usbip_use_stderr = 1;
opterr = 0;
for (;;) {
opt = getopt_long(argc, argv, "+d", opts, NULL);
@@ -154,7 +158,10 @@ int main(int argc, char *argv[])
switch (opt) {
case 'd':
usbip_use_debug = 1;
- usbip_use_stderr = 1;
+ break;
+ case 'l':
+ usbip_use_syslog = 1;
+ openlog("", LOG_PID, LOG_USER);
break;
default:
goto err_out;
--
1.7.5.2
next prev parent reply other threads:[~2011-06-20 5:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-20 5:44 [PATCH 00/22] staging: usbip: misc. userspace changes matt mooney
2011-06-20 5:44 ` [PATCH 01/22] staging: usbip: userspace: update cleanup.sh matt mooney
2011-06-20 5:44 ` [PATCH 02/22] staging: usbip: userspace: usbip_common.h: cleanup log macros matt mooney
2011-06-20 5:44 ` [PATCH 03/22] staging: usbip: userspace: usbip_common.h: move enums matt mooney
2011-06-20 5:44 ` [PATCH 04/22] staging: usbip: userspace: usbip_common.h: fixup header includes matt mooney
2011-06-20 5:44 ` [PATCH 05/22] staging: usbip: userspace: libsrc: set program name for logging matt mooney
2011-06-20 5:44 ` matt mooney [this message]
2011-06-20 5:44 ` [PATCH 07/22] staging: usbip: userspace: libsrc: remove usbip.h matt mooney
2011-06-20 5:44 ` [PATCH 08/22] staging: usbip: userspace: libsrc: change all output messages to debug matt mooney
2011-06-20 5:44 ` [PATCH 09/22] staging: usbip: userspace: usbip: modify command failure matt mooney
2011-06-20 5:44 ` [PATCH 10/22] staging: usbip: userspace: utils: remove libsysfs circumvention matt mooney
2011-06-20 5:44 ` [PATCH 11/22] staging: usbip: userspace: utils.c: rewrite modify_match_busid matt mooney
2011-06-20 5:44 ` [PATCH 12/22] staging: usbip: userspace: usbip_bind.c: major rewrite of the implementation matt mooney
2011-06-20 5:44 ` [PATCH 13/22] staging: usbip: userspace: usbip_unbind.c: implement using libsysfs matt mooney
2011-06-20 5:44 ` [PATCH 14/22] staging: usbip: userspace: usbip list: edit output messages matt mooney
2011-06-20 5:44 ` [PATCH 15/22] staging: usbip: userspace: usbip list: move output header matt mooney
2011-06-20 5:44 ` [PATCH 16/22] staging: usbip: userspace: rename stub driver files matt mooney
2011-06-20 5:44 ` [PATCH 17/22] staging: usbip: userspace: usbip_host: update function and variable names matt mooney
2011-06-20 5:44 ` [PATCH 18/22] staging: usbip: userspace: usbipd: major cleanup of daemon matt mooney
2011-06-20 5:44 ` [PATCH 19/22] staging: usbip: userspace: usbip_network.c: coding style cleanup matt mooney
2011-06-20 5:44 ` [PATCH 20/22] staging: usbip: userspace: add new prefix for usbip network code matt mooney
2011-06-20 5:44 ` [PATCH 21/22] staging: usbip: userspace: fix header installation bug matt mooney
2011-06-20 5:44 ` [PATCH 22/22] staging: usbip: userspace: configure.ac: change package data matt mooney
2011-07-06 3:12 ` [PATCH 00/22] staging: usbip: misc. userspace changes Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8a6d045c9214a4af84e7a3f186abe3e7af3fd3d4.1308547654.git.mfm@muteddisk.com \
--to=mfm@muteddisk.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®