- add libbb function str_tolower to convert a string to lowercase.
[oweals/busybox.git] / miscutils / runlevel.c
index dfa846f81b2255a0757c53c6d79e9c257334938c..df2da2b1f969ae6bffb5e3da55dddd48b1a72f10 100644 (file)
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
 /*
  * runlevel    Prints out the previous and the current runlevel.
  *
  * initially busyboxified by Bernhard Fischer
  */
 
+#include "busybox.h"
 #include <stdio.h>
 #include <utmp.h>
 #include <time.h>
 #include <stdlib.h>
 
-#include "busybox.h"
-
-int runlevel_main(int argc, char *argv[])
+int runlevel_main(int argc, char **argv);
+int runlevel_main(int argc, char **argv)
 {
-  struct utmp *ut;
-  char prev;
+       struct utmp *ut;
+       char prev;
 
-  if (argc > 1) utmpname(argv[1]);
+       if (argc > 1) utmpname(argv[1]);
 
-  setutent();
-  while ((ut = getutent()) != NULL) {
-       if (ut->ut_type == RUN_LVL) {
-               prev = ut->ut_pid / 256;
-               if (prev == 0) prev = 'N';
-               printf("%c %c\n", prev, ut->ut_pid % 256);
-               endutent();
-               return (0);
+       setutent();
+       while ((ut = getutent()) != NULL) {
+               if (ut->ut_type == RUN_LVL) {
+                       prev = ut->ut_pid / 256;
+                       if (prev == 0) prev = 'N';
+                       printf("%c %c\n", prev, ut->ut_pid % 256);
+                       endutent();
+                       return 0;
+               }
        }
-  }
 
-  printf("unknown\n");
-  endutent();
-  return (1);
+       puts("unknown");
+       endutent();
+       return 1;
 }
-