shutdown: style fix
This commit is contained in:
@@ -51,9 +51,9 @@ parseTime(char *arg, char *argv, int32 *_i)
|
|||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (unit[0] == '\0' || !strcmp(unit, "s"))
|
if (unit[0] == '\0' || strcmp(unit, "s") == 0)
|
||||||
return true;
|
return true;
|
||||||
if (!strcmp(unit, "m")) {
|
if (strcmp(unit, "m") == 0) {
|
||||||
gTimeToSleep *= 60;
|
gTimeToSleep *= 60;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -90,9 +90,9 @@ main(int argc, char **argv)
|
|||||||
program++;
|
program++;
|
||||||
|
|
||||||
// handle 'halt' and 'reboot' symlinks
|
// handle 'halt' and 'reboot' symlinks
|
||||||
if (!strcmp(program, "reboot"))
|
if (strcmp(program, "reboot") == 0)
|
||||||
gReboot = true;
|
gReboot = true;
|
||||||
if (strcmp(program, "shutdown"))
|
if (strcmp(program, "shutdown") != 0)
|
||||||
askUser = true;
|
askUser = true;
|
||||||
|
|
||||||
for (int32 i = 1; i < argc; i++) {
|
for (int32 i = 1; i < argc; i++) {
|
||||||
@@ -134,7 +134,7 @@ main(int argc, char **argv)
|
|||||||
int32 thread_cookie = 0;
|
int32 thread_cookie = 0;
|
||||||
while (get_next_thread_info(teamInfo.team,
|
while (get_next_thread_info(teamInfo.team,
|
||||||
&thread_cookie, &threadInfo) == B_OK) {
|
&thread_cookie, &threadInfo) == B_OK) {
|
||||||
if (!strcmp(threadInfo.name, "shutdown"))
|
if (strcmp(threadInfo.name, "shutdown") == 0)
|
||||||
kill(threadInfo.thread, SIGUSR1);
|
kill(threadInfo.thread, SIGUSR1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user