mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-25 23:21:33 +03:00
journal-gateway: use _cleanup_ attribute to stop microhttpd daemon
This commit is contained in:
parent
c03a80c419
commit
0d2a1a2085
@ -982,7 +982,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
struct MHD_Daemon *d = NULL;
|
||||
_cleanup_(MHD_stop_daemonp) struct MHD_Daemon *d = NULL;
|
||||
int r, n;
|
||||
|
||||
log_setup_service();
|
||||
@ -1068,8 +1068,5 @@ int main(int argc, char *argv[]) {
|
||||
r = EXIT_SUCCESS;
|
||||
|
||||
finish:
|
||||
if (d)
|
||||
MHD_stop_daemon(d);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
@ -73,3 +73,5 @@ int check_permissions(struct MHD_Connection *connection, int *code, char **hostn
|
||||
* interesting events without overwhelming detail.
|
||||
*/
|
||||
int setup_gnutls_logger(char **categories);
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct MHD_Daemon*, MHD_stop_daemon);
|
||||
|
Loading…
Reference in New Issue
Block a user