}
static int create_log_socket(int type) {
- int fd;
struct timeval tv;
+ int fd;
fd = socket(AF_UNIX, type|SOCK_CLOEXEC, 0);
if (fd < 0)
}
static int log_open_syslog(void) {
- int r;
- union sockaddr_union sa = {
+
+ static const union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
.un.sun_path = "/dev/log",
};
+ int r;
+
if (syslog_fd >= 0)
return 0;
}
static int log_open_journal(void) {
- union sockaddr_union sa = {
+
+ static const union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
.un.sun_path = "/run/systemd/journal/socket",
};
+
int r;
if (journal_fd >= 0)
static int write_to_console(
int level,
int error,
- const char*file,
+ const char *file,
int line,
const char *func,
const char *object_field,
static int write_to_syslog(
int level,
int error,
- const char*file,
+ const char *file,
int line,
const char *func,
const char *object_field,
static int log_dispatch(
int level,
int error,
- const char*file,
+ const char *file,
int line,
const char *func,
const char *object_field,