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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « signaller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: system_utils.h
diff --git a/system_utils.h b/system_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..d07dc198d54680e3387956212a0761f36ececd0e
--- /dev/null
+++ b/system_utils.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef LOGIN_MANAGER_SYSTEM_UTILS_H_
+#define LOGIN_MANAGER_SYSTEM_UTILS_H_
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <base/basictypes.h>
+
+namespace login_manager {
+class SystemUtils {
+ public:
+ SystemUtils() {}
+ virtual ~SystemUtils() {}
+
+ virtual int kill(pid_t pid, int signal) {
+ return ::kill(pid, signal);
+ }
+
+ virtual bool child_is_gone(pid_t child_spec) {
+ return ::waitpid(child_spec, NULL, WNOHANG) == -1 && errno == ECHILD;
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SystemUtils);
+};
+} // namespace login_manager
+
+#endif // LOGIN_MANAGER_SYSTEM_UTILS_H_
« 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