1
From 6570acdf2166f65dc5d5ad1c46ee067ff42e9f33 Mon Sep 17 00:00:00 2001
2
From: Colin Ian King <colin.king@canonical.com>
3
Date: Tue, 21 Jan 2014 12:34:53 +0000
4
Subject: [PATCH 2/3] Fix log messages that don't have a trailing newline at
7
Some of the log messages are not emitting a newline, which makes
8
the output confusing when several of these are emitted.
10
Signed-off-by: Colin Ian King <colin.king@canonical.com>
12
src/android_main.cpp | 6 +++---
13
src/main.cpp | 12 ++++++------
14
src/thd_engine.cpp | 10 +++++-----
15
3 files changed, 14 insertions(+), 14 deletions(-)
17
diff --git a/src/android_main.cpp b/src/android_main.cpp
18
index 64530cb..3f35267 100644
19
--- a/src/android_main.cpp
20
+++ b/src/android_main.cpp
21
@@ -60,7 +60,7 @@ static void signal_handler(int sig) {
25
- thd_log_warn("Unhandled signal %s", strsignal(sig));
26
+ thd_log_warn("Unhandled signal %s\n", strsignal(sig));
30
@@ -117,7 +117,7 @@ static void daemonize(char *rundir, char *pidfile) {
31
pid_file_handle = open(pidfile, O_RDWR | O_CREAT, 0600);
32
if (pid_file_handle == -1) {
33
/* Couldn't open lock file */
34
- thd_log_info("Could not open PID lock file %s, exiting", pidfile);
35
+ thd_log_info("Could not open PID lock file %s, exiting\n", pidfile);
38
/* Try to lock file */
39
@@ -225,7 +225,7 @@ int main(int argc, char *argv[]) {
41
// Initialize thermald objects
42
if (thd_engine->thd_engine_start(false) != THD_SUCCESS) {
43
- thd_log_error("thermald engine start failed: ");
44
+ thd_log_error("thermald engine start failed:\n");
48
diff --git a/src/main.cpp b/src/main.cpp
49
index 05185e4..a026501 100644
52
@@ -222,13 +222,13 @@ static int thd_dbus_server_proc(gboolean no_daemon) {
53
// Create a main loop that will dispatch callbacks
54
g_main_loop = main_loop = g_main_loop_new(NULL, FALSE);
55
if (main_loop == NULL) {
56
- thd_log_error("Couldn't create GMainLoop:");
57
+ thd_log_error("Couldn't create GMainLoop:\n");
58
return THD_FATAL_ERROR;
61
bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
63
- thd_log_error("Couldn't connect to session bus: %s:",
64
+ thd_log_error("Couldn't connect to session bus: %s:\n",
66
return THD_FATAL_ERROR;
68
@@ -237,7 +237,7 @@ static int thd_dbus_server_proc(gboolean no_daemon) {
69
bus_proxy = dbus_g_proxy_new_for_name(bus, DBUS_SERVICE_DBUS,
70
DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
71
if (bus_proxy == NULL) {
72
- thd_log_error("Failed to get a proxy for D-Bus:");
73
+ thd_log_error("Failed to get a proxy for D-Bus:\n");
74
return THD_FATAL_ERROR;
77
@@ -252,12 +252,12 @@ static int thd_dbus_server_proc(gboolean no_daemon) {
79
thd_log_debug("RequestName returned %d.\n", result);
80
if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
81
- thd_log_error("Failed to get the primary well-known name:");
82
+ thd_log_error("Failed to get the primary well-known name:\n");
83
return THD_FATAL_ERROR;
85
value_obj = (PrefObject*) g_object_new(PREF_TYPE_OBJECT, NULL);
86
if (value_obj == NULL) {
87
- thd_log_error("Failed to create one Value instance:");
88
+ thd_log_error("Failed to create one Value instance:\n");
89
return THD_FATAL_ERROR;
92
@@ -284,7 +284,7 @@ static int thd_dbus_server_proc(gboolean no_daemon) {
93
// Initialize thermald objects
94
thd_engine->set_poll_interval(thd_poll_interval);
95
if (thd_engine->thd_engine_start(ignore_cpuid_check) != THD_SUCCESS) {
96
- thd_log_error("THD engine start failed: ");
97
+ thd_log_error("THD engine start failed:\n");
101
diff --git a/src/thd_engine.cpp b/src/thd_engine.cpp
102
index 2d04dbf..d1ceba5 100644
103
--- a/src/thd_engine.cpp
104
+++ b/src/thd_engine.cpp
105
@@ -150,7 +150,7 @@ int cthd_engine::thd_engine_start(bool ignore_cpuid_check) {
106
// Pipe is used for communication between two processes
107
ret = pipe(wake_fds);
109
- thd_log_error("Thermal sysfs: pipe creation failed %d: ", ret);
110
+ thd_log_error("Thermal sysfs: pipe creation failed %d:\n", ret);
111
return THD_FATAL_ERROR;
113
fcntl(wake_fds[0], F_SETFL, O_NONBLOCK);
114
@@ -171,21 +171,21 @@ int cthd_engine::thd_engine_start(bool ignore_cpuid_check) {
116
ret = read_thermal_sensors();
117
if (ret != THD_SUCCESS) {
118
- thd_log_error("Thermal sysfs Error in reading sensors");
119
+ thd_log_error("Thermal sysfs Error in reading sensors\n");
120
// This is a fatal error and daemon will exit
121
return THD_FATAL_ERROR;
124
ret = read_cooling_devices();
125
if (ret != THD_SUCCESS) {
126
- thd_log_error("Thermal sysfs Error in reading cooling devs");
127
+ thd_log_error("Thermal sysfs Error in reading cooling devs\n");
128
// This is a fatal error and daemon will exit
129
return THD_FATAL_ERROR;
132
ret = read_thermal_zones();
133
if (ret != THD_SUCCESS) {
134
- thd_log_error("No thermal sensors found");
135
+ thd_log_error("No thermal sensors found\n");
136
// This is a fatal error and daemon will exit
137
return THD_FATAL_ERROR;
139
@@ -529,7 +529,7 @@ void cthd_engine::thd_engine_reload_zones() {
141
int ret = read_thermal_zones();
142
if (ret != THD_SUCCESS) {
143
- thd_log_error("No thermal sensors found");
144
+ thd_log_error("No thermal sensors found\n");
145
// This is a fatal error and daemon will exit