log.c: New log_is_debug() function, hide access to debug variable

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-07-02 12:40:50 +02:00
1 parent e9d5512e1a
commit 51e1a907e6
6 files changed
+18 -11

No files matched your search

+2 -2
View File
@@ -255,7 +255,7 @@ static int service_start(svc_t *svc)
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
close(fd);
} else if (debug) {
} else if (log_is_debug()) {
int fd;
fd = open(CONSOLE, O_WRONLY | O_APPEND);
@@ -286,7 +286,7 @@ static int service_start(svc_t *svc)
waitpid(pid, NULL, 0);
exit(status);
} else if (debug) {
} else if (log_is_debug()) {
char buf[CMD_SIZE] = "";
for (i = 0; i < (MAX_NUM_SVC_ARGS - 1) && svc->args[i][0] != 0; i++) {