Ticket #3678: shutdown.c.2.diff

File shutdown.c.2.diff, 936 bytes (added by oco, 11 years ago)

Updated patch after discussion beetween axeld, stippi and mmu_man

  • src/system/kernel/shutdown.c

     
    11/*
     2 * Copyright 2009, Olivier Coursière. All rights reserved.
    23 * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
    34 * Distributed under the terms of the MIT License.
    45 */
     
    1112status_t
    1213system_shutdown(bool reboot)
    1314{
    14     // ToDo: shutdown all system services!
    15 
     15    int32 cookie = 0;
     16    team_info info;
     17   
     18    // Now shutdown all system services!
     19    // TODO: Once we are sure we can shutdown the system on all hardware
     20    // checking reboot may not be necessary anymore.
     21    if (reboot) {
     22        while (get_next_team_info(&cookie, &info) == B_OK) {
     23            if (info.team == B_SYSTEM_TEAM)
     24                continue;
     25            kill_team(info.team);
     26        }
     27    }
     28   
    1629    sync();
    1730
    1831    return arch_cpu_shutdown(reboot);