Skip to content

Commit

Permalink
Use the function instead of accessing the global variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed May 4, 2020
1 parent 70f201b commit 9198a41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/alivedetection.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/**
* @brief GLib log domain.
*/
#define G_LOG_DOMAIN "alive detection"
#define G_LOG_DOMAIN "alive scan"

struct scanner scanner;
struct scan_restrictions scan_restrictions;
Expand Down
2 changes: 1 addition & 1 deletion src/openvas_log_conf.cmake_in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
file=${GVM_LOG_DIR}/openvas.log
level=127

[alive detection]
[alive scan]
prepend=%t %s %p
separator=:
prepend_time_format=%Y-%m-%d %Hh%M.%S %Z
Expand Down
8 changes: 4 additions & 4 deletions src/processes.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <time.h> /* for time() */
#include <unistd.h> /* for fork() */

#include <gvm/base/logging.h> /* for gvm_log_lock/unlock() */

#undef G_LOG_DOMAIN
/**
* @brief GLib log domain.
Expand Down Expand Up @@ -90,8 +92,6 @@ init_child_signal_handlers (void)
openvas_signal (SIGPIPE, SIG_IGN);
}

extern GMutex *logger_mutex;

/**
* @brief Create a new process (fork).
*/
Expand All @@ -100,9 +100,9 @@ create_process (process_func_t function, void *argument)
{
int pid;

g_mutex_lock (logger_mutex);
gvm_log_lock ();
pid = fork ();
g_mutex_unlock (logger_mutex);
gvm_log_unlock ();

if (pid == 0)
{
Expand Down

0 comments on commit 9198a41

Please sign in to comment.