Changeset 1567

Show
Ignore:
Timestamp:
01/26/10 04:21:47 (6 months ago)
Author:
marek
Message:

batctl: omit log lines which don't start with the correct tag

All batman-adv log messages start with a distinct tag ("batman-adv:" at the
moment) which we can use to strip the kernel log and only show batman-adv
related messages.

Location:
trunk/batctl
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/batctl/functions.c

    r1511 r1567  
    3636#include "bat-hosts.h" 
    3737 
     38#define BATMAN_ADV_TAG "batman-adv:" 
    3839 
    3940static struct timeval start_time; 
     
    179180                        break; 
    180181 
     182                if (read_opt & LOG_MODE) { 
     183                        /* omit log lines which don't start with the correct tag */ 
     184                        if (strncmp(line_ptr, BATMAN_ADV_TAG, strlen(BATMAN_ADV_TAG)) != 0) 
     185                                continue; 
     186                } 
     187 
    181188                if (!(read_opt & USE_BAT_HOSTS)) { 
    182189                        printf("%s", line_ptr); 
  • trunk/batctl/sys.c

    r1560 r1567  
    6969                return read_file("", argv[found_args], read_opt); 
    7070        else 
    71                 return read_file("", "/dev/stdin", read_opt); 
     71                return read_file("", "/proc/self/fd/0", read_opt); 
    7272} 
    7373