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; |
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 |
} |
} |