Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/miscutils/runlevel.c

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

revision 815 by niro, Sat Sep 1 22:45:15 2007 UTC revision 816 by niro, Fri Apr 24 18:33:46 2009 UTC
# Line 9  Line 9 
9   *   *
10   * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.   * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
11   *   *
12   * initially busyboxified by Bernhard Fischer   * initially busyboxified by Bernhard Reutner-Fischer
13   */   */
14    
 #include "busybox.h"  
 #include <stdio.h>  
15  #include <utmp.h>  #include <utmp.h>
16  #include <time.h>  #include "libbb.h"
 #include <stdlib.h>  
17    
18  int runlevel_main(int argc, char *argv[])  int runlevel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
19    int runlevel_main(int argc, char **argv)
20  {  {
21   struct utmp *ut;   struct utmp *ut;
22   char prev;   char prev;
# Line 31  int runlevel_main(int argc, char *argv[] Line 29  int runlevel_main(int argc, char *argv[]
29   prev = ut->ut_pid / 256;   prev = ut->ut_pid / 256;
30   if (prev == 0) prev = 'N';   if (prev == 0) prev = 'N';
31   printf("%c %c\n", prev, ut->ut_pid % 256);   printf("%c %c\n", prev, ut->ut_pid % 256);
32   endutent();   if (ENABLE_FEATURE_CLEAN_UP)
33     endutent();
34   return 0;   return 0;
35   }   }
36   }   }
37    
38   puts("unknown");   puts("unknown");
39   endutent();  
40     if (ENABLE_FEATURE_CLEAN_UP)
41     endutent();
42   return 1;   return 1;
43  }  }

Legend:
Removed from v.815  
changed lines
  Added in v.816