remove unneeded #includes, fix indentation

This commit is contained in:
Denis Vlasenko
2006-09-23 16:01:09 +00:00
parent c1876d7364
commit c290563319
3 changed files with 47 additions and 61 deletions

View File

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