From cc3d85eb9714c52a513fd95ea6e4c16e1a4f224c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 18 Mar 2020 16:40:50 +0100 Subject: [PATCH] sd-bus: mark sd_bus_try_close() as deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit codesearch.debian.net shows no uses (except for the definition in systemd and elogind). $ cat > test.c int main() { sd_bus_try_close(NULL); return 0; } $ gcc -Isrc/systemd -Wall -o testbus test.c -lsystemd test.c: In function ‘main’: test.c:4:3: warning: ‘sd_bus_try_close’ is deprecated [-Wdeprecated-declarations] 4 | sd_bus_try_close(NULL); | ^~~~~~~~~~~~~~~~ In file included from test.c:1: src/systemd/sd-bus.h:180:5: note: declared here 180 | int sd_bus_try_close(sd_bus *bus) _sd_deprecated_; /* deprecated */ | ^~~~~~~~~~~~~~~~ --- src/systemd/sd-bus.h | 2 +- tools/meson-check-api-docs.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h index e6f32987457..aed214352bc 100644 --- a/src/systemd/sd-bus.h +++ b/src/systemd/sd-bus.h @@ -177,7 +177,7 @@ int sd_bus_get_sender(sd_bus *bus, const char **ret); int sd_bus_start(sd_bus *bus); -int sd_bus_try_close(sd_bus *bus); +int sd_bus_try_close(sd_bus *bus) _sd_deprecated_; /* deprecated */ void sd_bus_close(sd_bus *bus); sd_bus *sd_bus_ref(sd_bus *bus); diff --git a/tools/meson-check-api-docs.sh b/tools/meson-check-api-docs.sh index bd320562adc..c33672934da 100755 --- a/tools/meson-check-api-docs.sh +++ b/tools/meson-check-api-docs.sh @@ -6,7 +6,7 @@ sd_total=0 udev_good=0 udev_total=0 -for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | sort -u` ; do +for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv sd_bus_try_close | sort -u` ; do if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then echo "✓ Symbol $symbol() is documented." good=1 -- 2.47.3