~ubuntu-branches/ubuntu/utopic/thermald/utopic

« back to all changes in this revision

Viewing changes to debian/patches/0004-Fix-log-messages-that-don-t-have-a-trailing-newline-.patch

  • Committer: Package Import Robot
  • Author(s): Colin King
  • Date: 2014-05-19 12:41:22 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140519124122-zan11arvjxtbqcq5
Tags: 1.2-1
* Adjust for coretemp path change
* Deny non root users to send system bus dbus messages
* Remove compile warning
* Remove rpmlint warning for manual page
* Remove old patches that are now included into version 1.2
* Sync up with version 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 end
6
 
 
7
 
Some of the log messages are not emitting a newline, which makes
8
 
the output confusing when several of these are emitted.
9
 
 
10
 
Signed-off-by: Colin Ian King <colin.king@canonical.com>
11
 
---
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(-)
16
 
 
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) {
22
 
                exit(EXIT_SUCCESS);
23
 
                break;
24
 
        default:
25
 
-               thd_log_warn("Unhandled signal %s", strsignal(sig));
26
 
+               thd_log_warn("Unhandled signal %s\n", strsignal(sig));
27
 
                break;
28
 
        }
29
 
 }
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);
36
 
                exit(EXIT_FAILURE);
37
 
        }
38
 
        /* Try to lock file */
39
 
@@ -225,7 +225,7 @@ int main(int argc, char *argv[]) {
40
 
 
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");
45
 
                exit(EXIT_FAILURE);
46
 
        }
47
 
 #ifdef VALGRIND_TEST
48
 
diff --git a/src/main.cpp b/src/main.cpp
49
 
index 05185e4..a026501 100644
50
 
--- a/src/main.cpp
51
 
+++ b/src/main.cpp
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;
59
 
        }
60
 
        if (dbus_enable) {
61
 
                bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
62
 
                if (error != NULL) {
63
 
-                       thd_log_error("Couldn't connect to session bus: %s:",
64
 
+                       thd_log_error("Couldn't connect to session bus: %s:\n",
65
 
                                        error->message);
66
 
                        return THD_FATAL_ERROR;
67
 
                }
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;
75
 
                }
76
 
 
77
 
@@ -252,12 +252,12 @@ static int thd_dbus_server_proc(gboolean no_daemon) {
78
 
                }
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;
84
 
                }
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;
90
 
                }
91
 
 
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");
98
 
                closelog();
99
 
                exit(EXIT_FAILURE);
100
 
        }
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);
108
 
        if (ret) {
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;
112
 
        }
113
 
        fcntl(wake_fds[0], F_SETFL, O_NONBLOCK);
114
 
@@ -171,21 +171,21 @@ int cthd_engine::thd_engine_start(bool ignore_cpuid_check) {
115
 
 
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;
122
 
        }
123
 
 
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;
130
 
        }
131
 
 
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;
138
 
        }
139
 
@@ -529,7 +529,7 @@ void cthd_engine::thd_engine_reload_zones() {
140
 
 
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
146
 
                return;
147
 
        }
148
 
1.8.5.3
149