Changeset 4928


Ignore:
Timestamp:
02/24/09 12:47:53 (4 years ago)
Author:
werner
Message:

Add option -d to enable debug output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • developers/werner/athintd/athintd.c

    r4925 r4928  
    2727 
    2828 
    29 #define WMI_ERROR_REPORT_EVENTID        (0x1001+1022-1010) 
     29#define WMI_ERROR_REPORT_EVENTID        (0x1001+1022-1010)      /* 0x100d */ 
    3030 
    3131 
     
    117117        const struct nlmsghdr *hdr; 
    118118 
    119         for (hdr = buf; NLMSG_OK(hdr, len); hdr = NLMSG_NEXT(hdr, len)) { 
     119        for (hdr = buf; NLMSG_OK(hdr, len); hdr = NLMSG_NEXT(hdr, len)) 
    120120                switch (hdr->nlmsg_type) { 
    121121                case NLMSG_NOOP: 
     
    128128                        break; 
    129129                } 
    130         } 
    131130} 
    132131 
     
    175174int main(int argc, char **argv) 
    176175{ 
    177         if (argc != 2) 
     176        int c; 
     177 
     178        while ((c = getopt(argc, argv, "d")) != EOF) 
     179                switch (c) { 
     180                case 'd': 
     181                        debug = 1; 
     182                        break; 
     183                default: 
     184                        usage(*argv); 
     185                } 
     186 
     187        if (argc != optind+1) 
    178188                usage(*argv); 
    179         cmd = argv[1]; 
     189        cmd = argv[optind]; 
    180190        openlog("athintd", LOG_CONS, LOG_USER); 
    181191        loop(); 
Note: See TracChangeset for help on using the changeset viewer.