diff --git a/src/system/kernel/shutdown.c b/src/system/kernel/shutdown.c index 8821601d44..16b8056fb6 100644 --- a/src/system/kernel/shutdown.c +++ b/src/system/kernel/shutdown.c @@ -1,4 +1,5 @@ /* + * Copyright 2009, Olivier Coursière. All rights reserved. * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -11,8 +12,20 @@ status_t system_shutdown(bool reboot) { - // ToDo: shutdown all system services! - + int32 cookie = 0; + team_info info; + + // Now shutdown all system services! + // TODO: Once we are sure we can shutdown the system on all hardware + // checking reboot may not be necessary anymore. + if (reboot) { + while (get_next_team_info(&cookie, &info) == B_OK) { + if (info.team == B_SYSTEM_TEAM) + continue; + kill_team(info.team); + } + } + sync(); return arch_cpu_shutdown(reboot);