Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/procps/pidof.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 10  Line 10 
10  #include "libbb.h"  #include "libbb.h"
11    
12  enum {  enum {
13   USE_FEATURE_PIDOF_SINGLE(OPTBIT_SINGLE,)   IF_FEATURE_PIDOF_SINGLE(OPTBIT_SINGLE,)
14   USE_FEATURE_PIDOF_OMIT(  OPTBIT_OMIT  ,)   IF_FEATURE_PIDOF_OMIT(  OPTBIT_OMIT  ,)
15   OPT_SINGLE = USE_FEATURE_PIDOF_SINGLE((1<<OPTBIT_SINGLE)) + 0,   OPT_SINGLE = IF_FEATURE_PIDOF_SINGLE((1<<OPTBIT_SINGLE)) + 0,
16   OPT_OMIT   = USE_FEATURE_PIDOF_OMIT(  (1<<OPTBIT_OMIT  )) + 0,   OPT_OMIT   = IF_FEATURE_PIDOF_OMIT(  (1<<OPTBIT_OMIT  )) + 0,
17  };  };
18    
19  int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;  int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
# Line 28  int pidof_main(int argc UNUSED_PARAM, ch Line 28  int pidof_main(int argc UNUSED_PARAM, ch
28    
29   /* do unconditional option parsing */   /* do unconditional option parsing */
30   opt = getopt32(argv, ""   opt = getopt32(argv, ""
31   USE_FEATURE_PIDOF_SINGLE ("s")   IF_FEATURE_PIDOF_SINGLE ("s")
32   USE_FEATURE_PIDOF_OMIT("o:", &omits));   IF_FEATURE_PIDOF_OMIT("o:", &omits));
33    
34  #if ENABLE_FEATURE_PIDOF_OMIT  #if ENABLE_FEATURE_PIDOF_OMIT
35   /* fill omit list.  */   /* fill omit list.  */
36   {   {
37   llist_t *omits_p = omits;   llist_t *omits_p = omits;
38   while (omits_p) {   while (1) {
39     omits_p = llist_find_str(omits_p, "%PPID");
40     if (!omits_p)
41     break;
42   /* are we asked to exclude the parent's process ID?  */   /* are we asked to exclude the parent's process ID?  */
43   if (strcmp(omits_p->data, "%PPID") == 0) {   omits_p->data = utoa((unsigned)getppid());
  omits_p->data = utoa((unsigned)getppid());  
  }  
  omits_p = omits_p->link;  
44   }   }
45   }   }
46  #endif  #endif

Legend:
Removed from v.983  
changed lines
  Added in v.984