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

Side by Side Diff: system_utils.cc

Issue 6815021: [login_manager] Code to add the owner to the whitelist in a device policy (Closed) Base URL: http://git.chromium.org/git/login_manager.git@master
Patch Set: address gauravsh comments Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « system_utils.h ('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
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 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/system_utils.h" 5 #include "login_manager/system_utils.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 <signal.h> 10 #include <signal.h>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 void SystemUtils::AppendToClobberLog(const char* msg) const { 143 void SystemUtils::AppendToClobberLog(const char* msg) const {
144 chromeos::ProcessImpl appender; 144 chromeos::ProcessImpl appender;
145 appender.AddArg("/sbin/clobber-log"); 145 appender.AddArg("/sbin/clobber-log");
146 appender.AddArg("--"); 146 appender.AddArg("--");
147 appender.AddArg(msg); 147 appender.AddArg(msg);
148 appender.Run(); 148 appender.Run();
149 } 149 }
150 150
151 void SystemUtils::SetGError(GError** error,
152 ChromeOSLoginError code,
153 const char* message) {
154 g_set_error(error, CHROMEOS_LOGIN_ERROR, code, "Login error: %s", message);
155 }
156
157 void SystemUtils::SetAndSendGError(ChromeOSLoginError code,
158 DBusGMethodInvocation* context,
159 const char* msg) {
160 GError* error = NULL;
161 SetGError(&error, code, msg);
162 dbus_g_method_return_error(context, error);
163 g_error_free(error);
164 }
165
151 } // namespace login_manager 166 } // namespace login_manager
OLDNEW
« no previous file with comments | « system_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698