chiark / gitweb /
rtnl: drop "sd_" prefix from cleanup macros
authorLennart Poettering <lennart@poettering.net>
Thu, 13 Feb 2014 02:44:14 +0000 (03:44 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 13 Feb 2014 02:44:14 +0000 (03:44 +0100)
The "sd_" prefix is supposed to be used on exported symbols only, and
not in the middle of names. Let's drop it from the cleanup macros hence,
to make things simpler.

The bus cleanup macros don't carry the "sd_" either, so this brings the
APIs a bit nearer.

12 files changed:
src/core/loopback-setup.c
src/libsystemd/sd-rtnl/rtnl-internal.h
src/libsystemd/sd-rtnl/rtnl-util.c
src/libsystemd/sd-rtnl/rtnl-util.h
src/libsystemd/sd-rtnl/sd-rtnl.c
src/libsystemd/sd-rtnl/test-rtnl.c
src/network/networkd-address.c
src/network/networkd-link.c
src/network/networkd-netdev.c
src/network/networkd-route.c
src/nspawn/nspawn.c
src/udev/udev-event.c

index 9058b6f..e8c4630 100644 (file)
@@ -48,7 +48,7 @@ static int pipe_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
 }
 
 static int add_addresses(sd_rtnl *rtnl, int if_loopback, struct in_addr *ipv4_address, int *counter) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *ipv4 = NULL, *ipv6 = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *ipv4 = NULL, *ipv6 = NULL;
         int r;
 
         r = sd_rtnl_message_addr_new(RTM_NEWADDR, if_loopback, AF_INET, &ipv4);
@@ -110,7 +110,7 @@ static int add_addresses(sd_rtnl *rtnl, int if_loopback, struct in_addr *ipv4_ad
 }
 
 static int start_interface(sd_rtnl *rtnl, int if_loopback, struct in_addr *ipv4_address, int *counter) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         r = sd_rtnl_message_link_new(RTM_SETLINK, if_loopback, &req);
@@ -157,7 +157,7 @@ static int check_loopback(void) {
 }
 
 int loopback_setup(void) {
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
         int r, if_loopback, counter = 0;
         bool eperm = false;
         struct in_addr ipv4_address;
index 4bfcb83..28c7b96 100644 (file)
@@ -103,4 +103,4 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret);
 
 /* Make sure callbacks don't destroy the rtnl connection */
 #define RTNL_DONT_DESTROY(rtnl) \
-        _cleanup_sd_rtnl_unref_ _unused_ sd_rtnl *_dont_destroy_##rtnl = sd_rtnl_ref(rtnl)
+        _cleanup_rtnl_unref_ _unused_ sd_rtnl *_dont_destroy_##rtnl = sd_rtnl_ref(rtnl)
index 29250c9..ba4fab0 100644 (file)
@@ -28,7 +28,7 @@
 #include "rtnl-internal.h"
 
 int rtnl_set_link_name(sd_rtnl *rtnl, int ifindex, const char *name) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *message = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *message = NULL;
         int r;
 
         assert(rtnl);
@@ -52,7 +52,7 @@ int rtnl_set_link_name(sd_rtnl *rtnl, int ifindex, const char *name) {
 
 int rtnl_set_link_properties(sd_rtnl *rtnl, int ifindex, const char *alias,
                              const struct ether_addr *mac, unsigned mtu) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *message = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *message = NULL;
         bool need_update = false;
         int r;
 
index d590ca7..33746af 100644 (file)
@@ -42,5 +42,5 @@ int rtnl_message_link_get_ifname(sd_rtnl_message *m, const char **ret);
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl*, sd_rtnl_unref);
 DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl_message*, sd_rtnl_message_unref);
 
-#define _cleanup_sd_rtnl_unref_ _cleanup_(sd_rtnl_unrefp)
-#define _cleanup_sd_rtnl_message_unref_ _cleanup_(sd_rtnl_message_unrefp)
+#define _cleanup_rtnl_unref_ _cleanup_(sd_rtnl_unrefp)
+#define _cleanup_rtnl_message_unref_ _cleanup_(sd_rtnl_message_unrefp)
index 04fcb3d..0588965 100644 (file)
@@ -71,7 +71,7 @@ static bool rtnl_pid_changed(sd_rtnl *rtnl) {
 }
 
 int sd_rtnl_open(uint32_t groups, sd_rtnl **ret) {
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
         socklen_t addrlen;
         int r;
 
@@ -241,7 +241,7 @@ static int dispatch_wqueue(sd_rtnl *rtnl) {
 }
 
 static int process_timeout(sd_rtnl *rtnl) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *m = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
         struct reply_callback *c;
         usec_t n;
         int r;
@@ -315,7 +315,7 @@ static int process_match(sd_rtnl *rtnl, sd_rtnl_message *m) {
 }
 
 static int process_running(sd_rtnl *rtnl, sd_rtnl_message **ret) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *m = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
         int r;
 
         assert(rtnl);
@@ -557,7 +557,7 @@ int sd_rtnl_call(sd_rtnl *nl,
 
         for (;;) {
                 usec_t left;
-                _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *incoming = NULL;
+                _cleanup_rtnl_message_unref_ sd_rtnl_message *incoming = NULL;
 
                 if (!room) {
                         sd_rtnl_message **q;
index 2401514..bc88300 100644 (file)
@@ -30,7 +30,7 @@
 #include "event-util.h"
 
 static void test_link_configure(sd_rtnl *rtnl, int ifindex) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *message;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *message;
         uint16_t type;
         const char *mac = "98:fe:94:3f:c6:18", *name = "test";
         unsigned int mtu = 1450;
@@ -130,7 +130,7 @@ static void test_link_get(sd_rtnl *rtnl, int ifindex) {
 }
 
 static void test_route(void) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req;
         struct in_addr addr;
         uint32_t index = 2;
         uint16_t type;
@@ -208,8 +208,8 @@ static int link_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
 
 static void test_event_loop(int ifindex) {
         _cleanup_event_unref_ sd_event *event = NULL;
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *m = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
         char *ifname;
 
         ifname = strdup("lo2");
@@ -240,8 +240,8 @@ static int pipe_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
 }
 
 static void test_async(int ifindex) {
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *m = NULL, *r = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL, *r = NULL;
         uint32_t serial;
         char *ifname;
 
@@ -259,8 +259,8 @@ static void test_async(int ifindex) {
 }
 
 static void test_pipe(int ifindex) {
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *m1 = NULL, *m2 = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *m1 = NULL, *m2 = NULL;
         int counter = 0;
 
         assert(sd_rtnl_open(0, &rtnl) >= 0);
@@ -281,7 +281,7 @@ static void test_pipe(int ifindex) {
 }
 
 static void test_container(void) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *m = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
         uint16_t type;
         void *data;
 
@@ -323,7 +323,7 @@ static void test_container(void) {
 }
 
 static void test_match(void) {
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
 
         assert(sd_rtnl_open(0, &rtnl) >= 0);
 
index aa7927f..94e7a9c 100644 (file)
@@ -95,7 +95,7 @@ void address_free(Address *address) {
 
 int address_drop(Address *address, Link *link,
                  sd_rtnl_message_handler_t callback) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         assert(address);
@@ -139,7 +139,7 @@ int address_drop(Address *address, Link *link,
 
 int address_configure(Address *address, Link *link,
                       sd_rtnl_message_handler_t callback) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         assert(address);
index 39c61d8..3ef7622 100644 (file)
@@ -426,7 +426,7 @@ static int set_mtu_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
 }
 
 static int link_set_mtu(Link *link, uint32_t mtu) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         assert(link);
@@ -783,7 +783,7 @@ static int link_up_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
 }
 
 static int link_up(Link *link) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         assert(link);
@@ -950,7 +950,7 @@ static int link_get_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
 }
 
 static int link_get(Link *link) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         assert(link);
index c9b9b2b..8c9fa62 100644 (file)
@@ -84,7 +84,7 @@ static int netdev_enter_failed(NetDev *netdev) {
 }
 
 static int netdev_enslave_ready(NetDev *netdev, Link* link, sd_rtnl_message_handler_t callback) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         assert(netdev);
@@ -158,7 +158,7 @@ static int netdev_create_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userda
 }
 
 static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t callback) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         const char *kind;
         int r;
 
index 29ee104..31d4177 100644 (file)
@@ -96,7 +96,7 @@ void route_free(Route *route) {
 
 int route_configure(Route *route, Link *link,
                     sd_rtnl_message_handler_t callback) {
-        _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         int r;
 
         assert(link);
index 160b50b..1437aa7 100644 (file)
@@ -1252,7 +1252,7 @@ static int reset_audit_loginuid(void) {
 }
 
 static int move_network_interfaces(pid_t pid) {
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
         char **i;
         int r;
 
@@ -1269,7 +1269,7 @@ static int move_network_interfaces(pid_t pid) {
         }
 
         STRV_FOREACH(i, arg_network_interfaces) {
-                _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *m = NULL;
+                _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
                 unsigned ifi;
 
                 ifi = if_nametoindex(*i);
index 228232b..c8e216c 100644 (file)
@@ -748,7 +748,7 @@ out:
 static int rename_netif(struct udev_event *event)
 {
         struct udev_device *dev = event->dev;
-        _cleanup_sd_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
         char name[IFNAMSIZ];
         const char *oldname;
         int r;