Skip to content

Commit 5668330

Browse files
authored
Merge pull request #43 from ssahani/journal-structed-data
Various cleanups
2 parents 5d3e464 + f307cb2 commit 5668330

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ all: build
33
.PHONY: all
44

55
build:
6-
meson build
6+
meson setup build
77

88
clean:
99
rm -rf build/
File renamed without changes.

meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('systemd-netlogd', 'c',
2-
version : '1',
2+
version : '1.3',
33
license : 'LGPLv2+',
44
default_options: [
55
'c_std=gnu99',
@@ -152,8 +152,8 @@ if not libcap.found()
152152
endif
153153

154154
systemd_netlogd_conf = configure_file(
155-
input : 'conf/systemd-netlogd.conf.in',
156-
output : 'systemd-netlogd.conf',
155+
input : 'conf/netlogd.conf.in',
156+
output : 'netlogd.conf',
157157
configuration : substs)
158158
install_data(systemd_netlogd_conf,
159159
install_dir : get_option('sysconfdir'))

src/netlog/netlog-conf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ int config_parse_log_format(const char *unit,
9595
int manager_parse_config_file(Manager *m) {
9696
assert(m);
9797

98-
return config_parse_many(PKGSYSCONFDIR "/systemd-netlogd.conf",
99-
CONF_PATHS_NULSTR("systemd/systemd-netlogd.conf.d"),
98+
return config_parse_many(PKGSYSCONFDIR "/netlogd.conf",
99+
CONF_PATHS_NULSTR("systemd/netlogd.conf.d"),
100100
"Network\0",
101101
config_item_perf_lookup, netlog_gperf_lookup,
102102
false, m);

src/netlog/netlog-manager.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int process_journal_input(Manager *m) {
215215
assert(m);
216216
assert(m->journal);
217217

218-
while (true) {
218+
for (;;) {
219219
r = sd_journal_next(m->journal);
220220
if (r < 0) {
221221
log_error_errno(r, "Failed to get next entry: %m");
@@ -342,8 +342,7 @@ static int manager_journal_monitor_listen(Manager *m) {
342342
if (m->last_cursor) {
343343
r = sd_journal_seek_cursor(m->journal, m->last_cursor);
344344
if (r < 0)
345-
return log_error_errno(r, "Failed to seek to cursor %s: %m",
346-
m->last_cursor);
345+
return log_error_errno(r, "Failed to seek to cursor %s: %m", m->last_cursor);
347346
}
348347

349348
return 0;
@@ -473,10 +472,15 @@ int manager_new(const char *state_file, const char *cursor, Manager **ret) {
473472
.log_format = SYSLOG_TRANSMISSION_LOG_FORMAT_RFC_5424,
474473
};
475474

475+
socket_address_parse(&m->address, "239.0.0.1:6000");
476+
477+
if (!m->state_file)
478+
return log_oom();
479+
476480
if (cursor) {
477481
m->last_cursor = strdup(cursor);
478482
if (!m->last_cursor)
479-
return -ENOMEM;
483+
return log_oom();
480484
}
481485

482486
r = sd_event_default(&m->event);

0 commit comments

Comments
 (0)