Skip to content

Commit 77d413f

Browse files
committed
cleanup: Do not put function name in log msg explicitly (it's done automatically by pmloglib)
1 parent d0a1873 commit 77d413f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

service/src/main.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int daemon_start(pid_t *pid)
5252
char *argv[] = {application_executable_path, NULL};
5353

5454
res = posix_spawn(pid, application_executable_path, NULL, NULL, argv, env_vars);
55-
DBG("posix_spawn: pid=%d, application_path=%s, env={%s,%s}",
55+
DBG("pid=%d, application_path=%s, env={%s,%s}",
5656
*pid, application_executable_path, env_library_path, env_armcap);
5757

5858
free(env_library_path);
@@ -115,24 +115,24 @@ int hyperiond_start(service_t* service)
115115
{
116116
int res = 0;
117117
if (!is_elevated()) {
118-
ERR("hyperiond_start: Not elevated");
118+
ERR("Not elevated");
119119
return 1;
120120
} else if (is_running(service->daemon_pid)) {
121-
ERR("hyperiond_start: Daemon already running");
121+
ERR("Daemon already running");
122122
return 2;
123123
}
124124

125125
res = daemon_start(&service->daemon_pid);
126-
DBG("hyperiond_start: daemon_start -> PID=%d", service->daemon_pid);
126+
DBG("daemon_start -> PID=%d", service->daemon_pid);
127127

128128
if (res != 0) {
129-
ERR("hyperiond_start: Failed daemon_start with res=%d", res);
129+
ERR("Failed daemon_start with res=%d", res);
130130
return 3;
131131
}
132132

133133
res = pthread_create(&service->execution_thread, NULL, execution_task, service);
134134
if (res != 0) {
135-
ERR("hyperiond_start: pthread_create failed, res=%d", res);
135+
ERR("pthread_create failed, res=%d", res);
136136
return 4;
137137
}
138138

@@ -144,22 +144,22 @@ int hyperiond_stop(service_t* service)
144144
int res = 0;
145145

146146
if (!is_elevated()) {
147-
ERR("hyperiond_stop: Not elevated");
147+
ERR("Not elevated");
148148
return 1;
149149
} else if (!is_running(service->daemon_pid)) {
150-
ERR("hyperiond_stop: Daemon not running");
150+
ERR("Daemon not running");
151151
return 2;
152152
}
153153

154154
res = kill(service->daemon_pid, SIGTERM);
155155
if (res != 0) {
156-
ERR("hyperiond_stop: kill failed, res=%d", res);
156+
ERR("kill failed, res=%d", res);
157157
return 3;
158158
}
159159

160160
res = pthread_join(service->execution_thread, NULL);
161161
if (res != 0) {
162-
ERR("hyperiond_stop: pthread_join failed, res=%d", res);
162+
ERR("pthread_join failed, res=%d", res);
163163
return 4;
164164
}
165165
service->execution_thread = (pthread_t) NULL;
@@ -174,20 +174,20 @@ int hyperiond_version(service_t* service)
174174
if (service->hyperiond_version == NULL) {
175175
service->hyperiond_version = (char *)calloc(FILENAME_MAX, 1);
176176
if (service->hyperiond_version == NULL) {
177-
ERR("hyperiond_version: Failed version buf allocation");
177+
ERR("Failed version buf allocation");
178178
return 1;
179179
}
180180

181181
char *command = hyperiond_version_cmdline();
182182
// Spawn process with read-only pipe
183183
FILE *fp = popen(command, "r");
184184
if (fp == NULL) {
185-
ERR("hyperiond_version: popen failed");
185+
ERR("popen failed");
186186
res = 2;
187187
} else {
188188
int bytes_read = fread(service->hyperiond_version, 1, FILENAME_MAX, fp);
189189
if (bytes_read == 0) {
190-
ERR("hyperiond_version: Reading process' stdout failed");
190+
ERR("Reading process' stdout failed");
191191
res = 3;
192192
}
193193

@@ -312,7 +312,7 @@ bool service_method_terminate(LSHandle* sh, LSMessage* msg, void* data __attribu
312312
LSError lserror;
313313
LSErrorInit(&lserror);
314314

315-
WARN("service_method_terminate: Terminating");
315+
WARN("Terminating");
316316

317317
jvalue_ref jobj = jobject_create();
318318
jobject_set(jobj, j_cstr_to_buffer("returnValue"), jboolean_create(true));

0 commit comments

Comments
 (0)