Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: system_utils.h

Issue 553016: port to use centralized constants files, and add input validation (Closed)
Patch Set: address shell injection, otehr comments (per wad) Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « signaller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef LOGIN_MANAGER_SYSTEM_UTILS_H_
6 #define LOGIN_MANAGER_SYSTEM_UTILS_H_
7
8 #include <errno.h>
9 #include <unistd.h>
10
11 #include <base/basictypes.h>
12
13 namespace login_manager {
14 class SystemUtils {
15 public:
16 SystemUtils() {}
17 virtual ~SystemUtils() {}
18
19 virtual int kill(pid_t pid, int signal) {
20 return ::kill(pid, signal);
21 }
22
23 virtual bool child_is_gone(pid_t child_spec) {
24 return ::waitpid(child_spec, NULL, WNOHANG) == -1 && errno == ECHILD;
25 }
26
27 private:
28 DISALLOW_COPY_AND_ASSIGN(SystemUtils);
29 };
30 } // namespace login_manager
31
32 #endif // LOGIN_MANAGER_SYSTEM_UTILS_H_
OLDNEW
« no previous file with comments | « signaller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698