| OLD | NEW |
| 1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "login_manager/session_manager_service.h" | 5 #include "login_manager/session_manager_service.h" |
| 6 | 6 |
| 7 #include <dbus/dbus-glib-lowlevel.h> | 7 #include <dbus/dbus-glib-lowlevel.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <glib.h> | 9 #include <glib.h> |
| 10 #include <grp.h> | 10 #include <grp.h> |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux | 823 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux |
| 824 // distros send SIGHUP, SIGTERM, and then SIGKILL. | 824 // distros send SIGHUP, SIGTERM, and then SIGKILL. |
| 825 action.sa_handler = SIGHUPHandler; | 825 action.sa_handler = SIGHUPHandler; |
| 826 CHECK(sigaction(SIGHUP, &action, NULL) == 0); | 826 CHECK(sigaction(SIGHUP, &action, NULL) == 0); |
| 827 } | 827 } |
| 828 | 828 |
| 829 void SessionManagerService::CleanupChildren(int timeout) { | 829 void SessionManagerService::CleanupChildren(int timeout) { |
| 830 for (size_t i_child = 0; i_child < child_pids_.size(); ++i_child) { | 830 for (size_t i_child = 0; i_child < child_pids_.size(); ++i_child) { |
| 831 int child_pid = child_pids_[i_child]; | 831 int child_pid = child_pids_[i_child]; |
| 832 if (child_pid > 0) { | 832 if (child_pid > 0) { |
| 833 system_->kill(child_pid, (session_started_ ? SIGTERM: SIGKILL)); | 833 system_->kill(-child_pid, (session_started_ ? SIGTERM : SIGKILL)); |
| 834 if (!system_->ChildIsGone(child_pid, timeout)) | 834 if (!system_->ChildIsGone(child_pid, timeout)) |
| 835 system_->kill(child_pid, SIGABRT); | 835 system_->kill(-child_pid, SIGABRT); |
| 836 } | 836 } |
| 837 } | 837 } |
| 838 } | 838 } |
| 839 | 839 |
| 840 void SessionManagerService::SetGError(GError** error, | 840 void SessionManagerService::SetGError(GError** error, |
| 841 ChromeOSLoginError code, | 841 ChromeOSLoginError code, |
| 842 const char* message) { | 842 const char* message) { |
| 843 g_set_error(error, CHROMEOS_LOGIN_ERROR, code, "Login error: %s", message); | 843 g_set_error(error, CHROMEOS_LOGIN_ERROR, code, "Login error: %s", message); |
| 844 } | 844 } |
| 845 | 845 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 arg_list.push_back(args[i_arg]); | 880 arg_list.push_back(args[i_arg]); |
| 881 } | 881 } |
| 882 } | 882 } |
| 883 if (arg_list.size()) { | 883 if (arg_list.size()) { |
| 884 arg_lists.push_back(arg_list); | 884 arg_lists.push_back(arg_list); |
| 885 } | 885 } |
| 886 return arg_lists; | 886 return arg_lists; |
| 887 } | 887 } |
| 888 | 888 |
| 889 } // namespace login_manager | 889 } // namespace login_manager |
| OLD | NEW |