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

Unified Diff: tools/android/forwarder2/daemon.cc

Issue 141683002: Add error messages in Daemon::Kill(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/device_forwarder/forwarder Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/forwarder2/daemon.cc
diff --git a/tools/android/forwarder2/daemon.cc b/tools/android/forwarder2/daemon.cc
index 0ca89d1a5fd5f958b59701da70e60a5c6b1e5ee1..0a7e502b85c16741a2476c494d5e0d52cf58b7f8 100644
--- a/tools/android/forwarder2/daemon.cc
+++ b/tools/android/forwarder2/daemon.cc
@@ -255,13 +255,17 @@ bool Daemon::SpawnIfNeeded() {
bool Daemon::Kill() {
pid_t daemon_pid = Socket::GetUnixDomainSocketProcessOwner(identifier_);
- if (daemon_pid < 0)
- return true; // No daemon running.
+ if (daemon_pid < 0) {
+ LOG(ERROR) << "No forwarder daemon seems to be running";
+ return true;
+ }
if (kill(daemon_pid, SIGTERM) < 0) {
- if (errno == ESRCH /* invalid PID */)
+ if (errno == ESRCH /* invalid PID */) {
// The daemon exited for some reason (e.g. kill by a process other than
// us) right before the call to kill() above.
+ LOG(ERROR) << "Could not kill daemon with PID " << daemon_pid;
return true;
+ }
PError("kill");
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698