Skip to content

Commit

Permalink
Merge pull request #127 from cgzones/wip
Browse files Browse the repository at this point in the history
Message event loop tweaks
  • Loading branch information
ssahani authored Oct 21, 2024
2 parents e8ddb8d + e750f1c commit d7232f8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/netlog/netlog-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ static int manager_journal_event_handler(sd_event_source *event, int fd, uint32_
Manager *m = userp;
int r;

assert(m);
assert(m->journal);
assert(m->journal_watch_fd == fd);

if (revents & EPOLLHUP) {
log_debug("Received HUP");
return 0;
Expand Down Expand Up @@ -335,6 +339,7 @@ static void close_journal_input(Manager *m) {

sd_journal_close(m->journal);
m->journal = NULL;
m->journal_watch_fd = -1;
}
}

Expand Down Expand Up @@ -466,14 +471,13 @@ void manager_disconnect(Manager *m) {

m->resolve_query = sd_resolve_query_unref(m->resolve_query);

close_journal_input(m);

manager_close_network_socket(m);

dtls_disconnect(m->dtls);
tls_disconnect(m->tls);

m->event_journal_input = sd_event_source_unref(m->event_journal_input);
m->event_journal_input = sd_event_source_disable_unref(m->event_journal_input);
close_journal_input(m);

sd_notifyf(false, "STATUS=Idle.");
}
Expand Down

0 comments on commit d7232f8

Please sign in to comment.