diff options
Diffstat (limited to 'miscutils/runlevel.c')
-rw-r--r-- | miscutils/runlevel.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/miscutils/runlevel.c b/miscutils/runlevel.c index a042a70..91d49fa 100644 --- a/miscutils/runlevel.c +++ b/miscutils/runlevel.c @@ -20,24 +20,23 @@ 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; } - |