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

Unified Diff: main.cc

Issue 3581002: Fixed several cromo problems. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cromo.git
Patch Set: Created 10 years, 3 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 | « Makefile ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: main.cc
diff --git a/main.cc b/main.cc
index ec1c5f860544368b3cef0fdf7bf9bce7fd28edca..9df916394874b4f902492995dd3b7c3f31749b79 100644
--- a/main.cc
+++ b/main.cc
@@ -61,7 +61,7 @@ static gboolean do_signal(void *arg) {
int sig = reinterpret_cast<int>(arg);
LOG(INFO) << "Signal: " << sig;
- if (sig == SIGTERM) {
+ if (sig == SIGTERM || sig == SIGINT) {
exit_main_loop();
}
@@ -76,7 +76,7 @@ static void *handle_signals(void *arg) {
sigaddset(&sigs, SIGTERM);
sigaddset(&sigs, SIGINT);
LOG(INFO) << "waiting for signals";
- while (info.si_signo != SIGTERM) {
+ while (info.si_signo != SIGTERM && info.si_signo != SIGINT) {
sigwaitinfo(&sigs, &info);
g_idle_add(do_signal, reinterpret_cast<void*>(info.si_signo));
}
@@ -199,7 +199,6 @@ int main(int argc, char* argv[]) {
conn.request_name(CromoServer::kServiceName);
server = new CromoServer(conn);
- MessageHandler m(server);
char buf[256];
snprintf(buf, sizeof(buf), "type='signal',interface='%s',member='%s'",
kDBusInterface, kDBusNameOwnerChanged);
@@ -209,7 +208,7 @@ int main(int argc, char* argv[]) {
power_manager::kSuspendDelay);
conn.add_match(buf);
DBus::MessageSlot mslot;
- mslot = &m;
+ mslot = new MessageHandler(server);
if (!conn.add_filter(mslot)) {
LOG(ERROR) << "Can't add filter";
} else {
« no previous file with comments | « Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698