summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-resolve
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2015-11-27 20:26:33 +0100
committerDavid Herrmann <dh.herrmann@googlemail.com>2015-11-27 20:26:33 +0100
commit564c44436cf64adc7a9eff8c17f386899194a893 (patch)
tree9c71d044032b117f84fd804e72def2236b7321b3 /src/libsystemd/sd-resolve
parente900a8467962da3483dd7b62cc7f41043a4584cf (diff)
parent9ead3519c54b6d1b79b35541873b5cf7c8b3a7d3 (diff)
Merge pull request #2052 from poettering/export-cleanup
Make gcc cleanup helper calls public in most of our sd-xyz APIs
Diffstat (limited to 'src/libsystemd/sd-resolve')
-rw-r--r--src/libsystemd/sd-resolve/resolve-util.h32
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c3
-rw-r--r--src/libsystemd/sd-resolve/test-resolve.c5
3 files changed, 3 insertions, 37 deletions
diff --git a/src/libsystemd/sd-resolve/resolve-util.h b/src/libsystemd/sd-resolve/resolve-util.h
deleted file mode 100644
index 51a8a8af83..0000000000
--- a/src/libsystemd/sd-resolve/resolve-util.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#pragma once
-
-/***
- This file is part of systemd.
-
- Copyright 2014 Daniel Buch
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "sd-resolve.h"
-
-#include "util.h"
-
-DEFINE_TRIVIAL_CLEANUP_FUNC(sd_resolve*, sd_resolve_unref);
-DEFINE_TRIVIAL_CLEANUP_FUNC(sd_resolve_query*, sd_resolve_query_unref);
-
-#define _cleanup_resolve_unref_ _cleanup_(sd_resolve_unrefp)
-#define _cleanup_resolve_query_unref_ _cleanup_(sd_resolve_query_unrefp)
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index 34a0b03f92..d6e6f396d4 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -38,7 +38,6 @@
#include "io-util.h"
#include "list.h"
#include "missing.h"
-#include "resolve-util.h"
#include "socket-util.h"
#include "util.h"
@@ -179,7 +178,7 @@ static int getnameinfo_done(sd_resolve_query *q);
static void resolve_query_disconnect(sd_resolve_query *q);
#define RESOLVE_DONT_DESTROY(resolve) \
- _cleanup_resolve_unref_ _unused_ sd_resolve *_dont_destroy_##resolve = sd_resolve_ref(resolve)
+ _cleanup_(sd_resolve_unrefp) _unused_ sd_resolve *_dont_destroy_##resolve = sd_resolve_ref(resolve)
static int send_died(int out_fd) {
diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c
index 05544a584c..e78a75c9ea 100644
--- a/src/libsystemd/sd-resolve/test-resolve.c
+++ b/src/libsystemd/sd-resolve/test-resolve.c
@@ -32,7 +32,6 @@
#include "alloc-util.h"
#include "macro.h"
-#include "resolve-util.h"
#include "socket-util.h"
#include "string-util.h"
@@ -71,8 +70,8 @@ static int getnameinfo_handler(sd_resolve_query *q, int ret, const char *host, c
}
int main(int argc, char *argv[]) {
- _cleanup_resolve_query_unref_ sd_resolve_query *q1 = NULL, *q2 = NULL;
- _cleanup_resolve_unref_ sd_resolve *resolve = NULL;
+ _cleanup_(sd_resolve_query_unrefp) sd_resolve_query *q1 = NULL, *q2 = NULL;
+ _cleanup_(sd_resolve_unrefp) sd_resolve *resolve = NULL;
int r = 0;
struct addrinfo hints = {