mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-25 23:21:33 +03:00
journal-remote: destroy RemoteServer object by using _cleanup_ attribute
This commit is contained in:
parent
f36bb1e182
commit
94952201e1
@ -1062,7 +1062,7 @@ static int load_certificates(char **key, char **cert, char **trust) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RemoteServer s = {};
|
||||
_cleanup_(journal_remote_server_destroy) RemoteServer s = {};
|
||||
int r;
|
||||
_cleanup_free_ char *key = NULL, *cert = NULL, *trust = NULL;
|
||||
|
||||
@ -1126,8 +1126,6 @@ int main(int argc, char **argv) {
|
||||
"STATUS=Shutting down after writing %" PRIu64 " entries...", s.event_count);
|
||||
log_info("Finishing after writing %" PRIu64 " entries", s.event_count);
|
||||
|
||||
journal_remote_server_destroy(&s);
|
||||
|
||||
free(arg_key);
|
||||
free(arg_cert);
|
||||
free(arg_trust);
|
||||
|
@ -346,7 +346,7 @@ static void MHDDaemonWrapper_free(MHDDaemonWrapper *d) {
|
||||
}
|
||||
#endif
|
||||
|
||||
RemoteServer* journal_remote_server_destroy(RemoteServer *s) {
|
||||
void journal_remote_server_destroy(RemoteServer *s) {
|
||||
size_t i;
|
||||
|
||||
#if HAVE_MICROHTTPD
|
||||
@ -370,7 +370,6 @@ RemoteServer* journal_remote_server_destroy(RemoteServer *s) {
|
||||
journal_remote_server_global = NULL;
|
||||
|
||||
/* fds that we're listening on remain open... */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -62,4 +62,4 @@ int journal_remote_handle_raw_source(
|
||||
uint32_t revents,
|
||||
RemoteServer *s);
|
||||
|
||||
RemoteServer* journal_remote_server_destroy(RemoteServer *s);
|
||||
void journal_remote_server_destroy(RemoteServer *s);
|
||||
|
Loading…
Reference in New Issue
Block a user