#include "console.h"#include <fcntl.h>#include <unistd.h>#include <stdio.h>#include <syslog.h>#include <errno.h>
Functions | |
| GString * | _get_fn_names (gint fns) |
| void | console_printf (const gchar *fmt,...) |
| gboolean | console_acquire_from_fds (gint fds[3], gint fds_to_steal) |
| void | console_release (void) |
| void | console_destroy (void) |
| void | console_global_init (const gchar *console_prefix_) |
| void | console_global_deinit (void) |
Variables | |
| GMutex | console_lock |
| gboolean | using_initial_console = TRUE |
| gboolean | console_destroyed = FALSE |
| const gchar * | console_prefix |
| gint | initial_console_fds [3] |
| gint | stolen_fds |
| GString* _get_fn_names | ( | gint | fns | ) |
| gboolean console_acquire_from_fds | ( | gint | fds[3], |
| gint | fds_to_steal | ||
| ) |
| void console_destroy | ( | void | ) |
| void console_global_deinit | ( | void | ) |
| void console_global_init | ( | const gchar * | console_prefix_ | ) |
| void console_printf | ( | const gchar * | fmt, |
| ... | |||
| ) |
This function sends a message to the client preferring to use the stderr channel as long as it is available and switching to using syslog() if it isn't. Generally the stderr channell will be available in the startup process and in the beginning of the first startup in the supervisor/daemon processes. Later on the stderr fd will be closed and we have to fall back to using the system log.
| void console_release | ( | void | ) |
Restore input/output/error. This function is idempotent, can be called any number of times without harm.
| gboolean console_destroyed = FALSE |
| GMutex console_lock |
| const gchar* console_prefix |
| gint initial_console_fds[3] |
| gint stolen_fds |
| gboolean using_initial_console = TRUE |