r4928 - developers/werner/athintd
werner at docs.openmoko.org
werner at docs.openmoko.org
Tue Feb 24 12:47:53 CET 2009
Author: werner
Date: 2009-02-24 12:47:53 +0100 (Tue, 24 Feb 2009)
New Revision: 4928
Modified:
developers/werner/athintd/athintd.c
Log:
Add option -d to enable debug output.
Modified: developers/werner/athintd/athintd.c
===================================================================
--- developers/werner/athintd/athintd.c 2009-02-24 11:47:04 UTC (rev 4927)
+++ developers/werner/athintd/athintd.c 2009-02-24 11:47:53 UTC (rev 4928)
@@ -26,7 +26,7 @@
#include <linux/wireless.h>
-#define WMI_ERROR_REPORT_EVENTID (0x1001+1022-1010)
+#define WMI_ERROR_REPORT_EVENTID (0x1001+1022-1010) /* 0x100d */
/*
@@ -116,7 +116,7 @@
{
const struct nlmsghdr *hdr;
- for (hdr = buf; NLMSG_OK(hdr, len); hdr = NLMSG_NEXT(hdr, len)) {
+ for (hdr = buf; NLMSG_OK(hdr, len); hdr = NLMSG_NEXT(hdr, len))
switch (hdr->nlmsg_type) {
case NLMSG_NOOP:
case NLMSG_OVERRUN:
@@ -127,7 +127,6 @@
newlink(NLMSG_DATA(hdr), IFLA_PAYLOAD(hdr));
break;
}
- }
}
@@ -174,9 +173,20 @@
int main(int argc, char **argv)
{
- if (argc != 2)
+ int c;
+
+ while ((c = getopt(argc, argv, "d")) != EOF)
+ switch (c) {
+ case 'd':
+ debug = 1;
+ break;
+ default:
+ usage(*argv);
+ }
+
+ if (argc != optind+1)
usage(*argv);
- cmd = argv[1];
+ cmd = argv[optind];
openlog("athintd", LOG_CONS, LOG_USER);
loop();
return 0;
More information about the commitlog
mailing list