]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: mark set-but-not-used variables as unused to make LLVM happy
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 15 Sep 2021 08:56:21 +0000 (10:56 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 15 Sep 2021 11:09:45 +0000 (13:09 +0200)
LLVM 13 introduced `-Wunused-but-set-variable` diagnostic flag, which
trips over some intentionally set-but-not-used variables or variables
attached to cleanup handlers with side effects (`_cleanup_umask_`,
`_cleanup_(notify_on_cleanup)`, `_cleanup_(restore_sigsetp)`, etc.):

```
../src/basic/process-util.c:1257:46: error: variable 'saved_ssp' set but not used [-Werror,-Wunused-but-set-variable]
        _cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL;
                                                     ^
                                                     1 error generated.
```

33 files changed:
src/basic/process-util.c
src/basic/unit-file.c
src/core/manager.c
src/core/namespace.c
src/cryptsetup/cryptsetup.c
src/home/homed.c
src/initctl/initctl.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-upload.c
src/journal/journald-server.c
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-journal/test-catalog.c
src/login/logind-core.c
src/login/logind-session.c
src/login/logind.c
src/network/networkd-dhcp-common.c
src/network/networkd.c
src/network/wait-online/wait-online.c
src/nspawn/nspawn.c
src/nss-systemd/userdb-glue.c
src/oom/oomd-manager.c
src/oom/oomd.c
src/resolve/resolved-dns-cache.c
src/resolve/resolved-dns-query.c
src/resolve/resolved.c
src/shared/barrier.c
src/shared/dev-setup.c
src/shared/utmp-wtmp.c
src/timesync/timesyncd.c
src/tty-ask-password-agent/tty-ask-password-agent.c
src/udev/udevd.c
src/userdb/userdbd.c

index ecb14306f8b1ca64a1003115c6b4dc4cc598f3fd..5855ac3d5793898be782f9a5cb61552fd2ab6191 100644 (file)
@@ -1254,7 +1254,7 @@ int safe_fork_full(
 
         pid_t original_pid, pid;
         sigset_t saved_ss, ss;
-        _cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL;
+        _unused_ _cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL;
         bool block_signals = false, block_all = false;
         int prio, r;
 
index 884a0674a9c06f0f5da91486716d78ca42b8547f..618cf8b4897aa22a09a278b38c50158aad46af74 100644 (file)
@@ -286,7 +286,8 @@ int unit_file_build_name_map(
 
                 FOREACH_DIRENT(de, d, log_warning_errno(errno, "Failed to read \"%s\", ignoring: %m", *dir)) {
                         char *filename;
-                        _cleanup_free_ char *_filename_free = NULL, *simplified = NULL;
+                        _unused_ _cleanup_free_ char *_filename_free = NULL;
+                        _cleanup_free_ char *simplified = NULL;
                         const char *suffix, *dst = NULL;
                         bool valid_unit_name;
 
index b767b0ee6c5eae0c32a289c641f52f74b8917ba3..60939b56aff09c22a01ce5c1eba04123ccc555c8 100644 (file)
@@ -1758,7 +1758,7 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds, const char *roo
 
         {
                 /* This block is (optionally) done with the reloading counter bumped */
-                _cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
+                _unused_ _cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
 
                 /* If we will deserialize make sure that during enumeration this is already known, so we increase the
                  * counter here already */
@@ -3275,7 +3275,7 @@ void manager_retry_runtime_watchdog(Manager *m) {
 }
 
 int manager_reload(Manager *m) {
-        _cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
+        _unused_ _cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
         _cleanup_fdset_free_ FDSet *fds = NULL;
         _cleanup_fclose_ FILE *f = NULL;
         int r;
index 8d4388ded5cd865d1ac8a27cad3af707737bad43..0d49f52217ea2ab05489fe586ef0467ce007b7ae 100644 (file)
@@ -853,7 +853,7 @@ static int mount_private_dev(MountEntry *m) {
         char temporary_mount[] = "/tmp/namespace-dev-XXXXXX";
         const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL, *devptmx = NULL;
         bool can_mknod = true;
-        _cleanup_umask_ mode_t u;
+        _unused_ _cleanup_umask_ mode_t u;
         int r;
 
         assert(m);
index ceaf10e6477dc792e32e0db3d41621155fa9e103..74ca1cb26259a5700d4b3e92a5fae676ef036465 100644 (file)
@@ -1674,7 +1674,7 @@ static int run(int argc, char *argv[]) {
         verb = argv[1];
 
         if (streq(verb, "attach")) {
-                _cleanup_(remove_and_erasep) const char *destroy_key_file = NULL;
+                _unused_ _cleanup_(remove_and_erasep) const char *destroy_key_file = NULL;
                 _cleanup_(erase_and_freep) void *key_data = NULL;
                 const char *volume, *source, *key_file, *options;
                 crypt_status_info status;
index 807d25e2735a235192ddefd000e2ed6b0a1785d1..579c289a686619d000a6eb2e01282223dd225ed3 100644 (file)
@@ -14,7 +14,7 @@
 
 static int run(int argc, char *argv[]) {
         _cleanup_(manager_freep) Manager *m = NULL;
-        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         int r;
 
         log_setup();
index c48fef16ef58a4829d7faaabdc68850f184cddea..a48a8570c47ea27b6ae9e598bd5ad0e1268a492a 100644 (file)
@@ -311,7 +311,7 @@ static int process_event(Server *s, struct epoll_event *ev) {
 
 static int run(int argc, char *argv[]) {
         _cleanup_(server_done) Server server = { .epoll_fd = -1 };
-        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         int r, n;
 
         if (argc > 1)
index 140ecac2073deabd34e364bb90feca5ad272382f..ba2a00da64acf18e7cd76fd4b329217f100c8990 100644 (file)
@@ -1099,7 +1099,7 @@ static int load_certificates(char **key, char **cert, char **trust) {
 
 static int run(int argc, char **argv) {
         _cleanup_(journal_remote_server_destroy) RemoteServer s = {};
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         _cleanup_(erase_and_freep) char *key = NULL;
         _cleanup_free_ char *cert = NULL, *trust = NULL;
         int r;
index 9c1ee0188dd334f68cd5b22395ea4627922a5e1a..13a9f74e6f013e8a678dc19d765cd338d05c1b8b 100644 (file)
@@ -272,7 +272,7 @@ int journal_remote_add_source(RemoteServer *s, int fd, char* name, bool own_name
 
 int journal_remote_add_raw_socket(RemoteServer *s, int fd) {
         int r;
-        _cleanup_close_ int fd_ = fd;
+        _unused_ _cleanup_close_ int fd_ = fd;
         char name[STRLEN("raw-socket-") + DECIMAL_STR_MAX(int) + 1];
 
         assert(fd >= 0);
index 3c28bbab7a20c5424b7f75f63c4f70d17d35959f..1456c9115f7443b547d5c4fe4a1ce72090b553b3 100644 (file)
@@ -820,7 +820,7 @@ static int open_journal(sd_journal **j) {
 
 static int run(int argc, char **argv) {
         _cleanup_(destroy_uploader) Uploader u = {};
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         bool use_journal;
         int r;
 
index 9de31c2be07073e6225438a8b933598df7c3fa8a..8c6684b2d35a8ccfac5a9af765997542ffe525cb 100644 (file)
@@ -903,7 +903,7 @@ static void dispatch_message_real(
                 pid_t object_pid) {
 
         char source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)];
-        _cleanup_free_ char *cmdline1 = NULL, *cmdline2 = NULL;
+        _unused_ _cleanup_free_ char *cmdline1 = NULL, *cmdline2 = NULL;
         uid_t journal_uid;
         ClientContext *o;
 
index 24da8411f662c7d85e7d3e251e01855ea6f2409f..b9268dfcd1925a759d2317f9a2d5fb2dab0c736e 100644 (file)
@@ -94,7 +94,8 @@ int device_add_property_aux(sd_device *device, const char *key, const char *valu
                 properties = &device->properties;
 
         if (value) {
-                _cleanup_free_ char *new_key = NULL, *new_value = NULL, *old_key = NULL, *old_value = NULL;
+                _unused_ _cleanup_free_ char *old_value = NULL;
+                _cleanup_free_ char *new_key = NULL, *new_value = NULL, *old_key = NULL;
                 int r;
 
                 r = ordered_hashmap_ensure_allocated(properties, &string_hash_ops_free_free);
@@ -119,7 +120,8 @@ int device_add_property_aux(sd_device *device, const char *key, const char *valu
                 TAKE_PTR(new_key);
                 TAKE_PTR(new_value);
         } else {
-                _cleanup_free_ char *old_key = NULL, *old_value = NULL;
+                _unused_ _cleanup_free_ char *old_value = NULL;
+                _cleanup_free_ char *old_key = NULL;
 
                 old_value = ordered_hashmap_remove2(*properties, key, (void**) &old_key);
         }
@@ -1939,7 +1941,8 @@ _public_ int sd_device_get_trigger_uuid(sd_device *device, sd_id128_t *ret) {
 }
 
 static int device_cache_sysattr_value(sd_device *device, const char *key, char *value) {
-        _cleanup_free_ char *new_key = NULL, *old_value = NULL;
+        _unused_ _cleanup_free_ char *old_value = NULL;
+        _cleanup_free_ char *new_key = NULL;
         int r;
 
         assert(device);
index 982fec0d8db41ecb6bdd61be98c83b127ec443c0..316c3b16344ad29f5f343c0e410b1dbd6a4379d0 100644 (file)
@@ -53,7 +53,7 @@ static void test_catalog_import_invalid(void) {
 }
 
 static void test_catalog_import_badid(void) {
-        _cleanup_ordered_hashmap_free_free_free_ OrderedHashmap *h = NULL;
+        _unused_ _cleanup_ordered_hashmap_free_free_free_ OrderedHashmap *h = NULL;
         const char *input =
 "-- 0027229ca0644181a76c4e92458afaff dededededededededededededededede\n" \
 "Subject: message\n" \
index 9d98d36b9f6f268bbbc0c82419e33c4199599e8a..57d2d64e494de08d500d57160a0ca8f310b9008a 100644 (file)
@@ -703,7 +703,7 @@ bool manager_all_buttons_ignored(Manager *m) {
 int manager_read_utmp(Manager *m) {
 #if ENABLE_UTMP
         int r;
-        _cleanup_(utxent_cleanup) bool utmpx = false;
+        _unused_ _cleanup_(utxent_cleanup) bool utmpx = false;
 
         assert(m);
 
index 3f09750ec9b4b1cbd6fe83467387c1021750f997..cde2b5e8bb39294baee5fc9d32edc98cf599f8d9 100644 (file)
@@ -1323,7 +1323,7 @@ bool session_is_controller(Session *s, const char *sender) {
 }
 
 static void session_release_controller(Session *s, bool notify) {
-        _cleanup_free_ char *name = NULL;
+        _unused_ _cleanup_free_ char *name = NULL;
         SessionDevice *sd;
 
         if (!s->controller)
index 478779900fa7fd729c9966581d9b7838003308f8..c128d64ed47afd6a43e336d8ffe0d6872587047c 100644 (file)
@@ -1157,7 +1157,7 @@ static int manager_run(Manager *m) {
 
 static int run(int argc, char *argv[]) {
         _cleanup_(manager_unrefp) Manager *m = NULL;
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         int r;
 
         log_set_facility(LOG_AUTH);
index 8739b6289139a178cf019a676c3bb1566a04b3ab..7a769988eccc80d60363bb7dbfa1a29dde0a407c 100644 (file)
@@ -702,8 +702,10 @@ int config_parse_dhcp_send_option(
                 void *data,
                 void *userdata) {
 
-        _cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *opt4 = NULL, *old4 = NULL;
-        _cleanup_(sd_dhcp6_option_unrefp) sd_dhcp6_option *opt6 = NULL, *old6 = NULL;
+        _cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *opt4 = NULL;
+        _cleanup_(sd_dhcp6_option_unrefp) sd_dhcp6_option *opt6 = NULL;
+        _unused_ _cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *old4 = NULL;
+        _unused_ _cleanup_(sd_dhcp6_option_unrefp) sd_dhcp6_option *old6 = NULL;
         uint32_t uint32_data, enterprise_identifier = 0;
         _cleanup_free_ char *word = NULL, *q = NULL;
         OrderedHashmap **options = data;
index 48f6061b1f2c109de0af7656bbcc5b17b076f648..ff3380c82cfc18ff7a3437d90fe2587bb0280f70 100644 (file)
@@ -19,7 +19,7 @@
 
 static int run(int argc, char *argv[]) {
         _cleanup_(manager_freep) Manager *m = NULL;
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         int r;
 
         log_setup();
index ad6f18bbd4c34bffca378539279c164ef23f6af8..a679b858fa13e7dc02343eb4accbac8a64b531de 100644 (file)
@@ -195,7 +195,7 @@ static int parse_argv(int argc, char *argv[]) {
 
 static int run(int argc, char *argv[]) {
         _cleanup_(manager_freep) Manager *m = NULL;
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         int r;
 
         log_setup();
index ff2081d405aab2fe53489d276751f04cf0770cc0..97e55adc48fad53416c5589ea523b41760ead308 100644 (file)
@@ -2196,7 +2196,7 @@ static int copy_devnodes(const char *dest) {
                 "tty\0"
                 "net/tun\0";
 
-        _cleanup_umask_ mode_t u;
+        _unused_ _cleanup_umask_ mode_t u;
         const char *d;
         int r = 0;
 
@@ -2279,7 +2279,7 @@ static int copy_devnodes(const char *dest) {
 }
 
 static int make_extra_nodes(const char *dest) {
-        _cleanup_umask_ mode_t u;
+        _unused_ _cleanup_umask_ mode_t u;
         size_t i;
         int r;
 
@@ -2480,7 +2480,7 @@ static int setup_kmsg(int kmsg_socket) {
         _cleanup_(unlink_and_freep) char *from = NULL;
         _cleanup_free_ char *fifo = NULL;
         _cleanup_close_ int fd = -1;
-        _cleanup_umask_ mode_t u;
+        _unused_ _cleanup_umask_ mode_t u;
         int r;
 
         assert(kmsg_socket >= 0);
index c865ff0d82e11f3da0cfb945898086152a757248..002e6925f957a4accb07403a4e5caf406d30c127 100644 (file)
@@ -303,7 +303,7 @@ enum nss_status userdb_getgrnam(
         }
 
         if (!g) {
-                _cleanup_(_nss_systemd_unblockp) bool blocked = false;
+                _unused_ _cleanup_(_nss_systemd_unblockp) bool blocked = false;
 
                 if (strv_isempty(members))
                         return NSS_STATUS_NOTFOUND;
@@ -365,7 +365,7 @@ enum nss_status userdb_getgrgid(
         }
 
         if (!g) {
-                _cleanup_(_nss_systemd_unblockp) bool blocked = false;
+                _unused_ _cleanup_(_nss_systemd_unblockp) bool blocked = false;
 
                 /* So, quite possibly we have to extend an existing group record with additional members. But
                  * to do this we need to know the group name first. The group didn't exist via non-NSS
index 4d7c28fe8ec1efd1852fe8668e6b69b60ced6c35..1f38f7eac1bc189daf1e1cf3b80a9bb284ca7f3c 100644 (file)
@@ -387,7 +387,7 @@ static void clear_candidate_hashmapp(Manager **m) {
 static int monitor_memory_pressure_contexts_handler(sd_event_source *s, uint64_t usec, void *userdata) {
         /* Don't want to use stale candidate data. Setting this will clear the candidate hashmap on return unless we
          * update the candidate data (in which case clear_candidates will be NULL). */
-        _cleanup_(clear_candidate_hashmapp) Manager *clear_candidates = userdata;
+        _unused_ _cleanup_(clear_candidate_hashmapp) Manager *clear_candidates = userdata;
         _cleanup_set_free_ Set *targets = NULL;
         bool in_post_action_delay = false;
         Manager *m = userdata;
index 5b50833df79bcc241611e288e0ad3113f16d4ecd..abc96a0587e68e6b8464847a11ad09f7d5bac6b1 100644 (file)
@@ -116,7 +116,7 @@ static int parse_argv(int argc, char *argv[]) {
 }
 
 static int run(int argc, char *argv[]) {
-        _cleanup_(notify_on_cleanup) const char *notify_msg = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_msg = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
         _cleanup_free_ char *swap = NULL;
         unsigned long long s = 0;
index f73ead872dd616efe7c3b799d1118da7dd2bd5e4..c2fca1fabea5bf09311e604cd230e61c39935ebf 100644 (file)
@@ -274,7 +274,7 @@ static int dns_cache_link_item(DnsCache *c, DnsCacheItem *i) {
 
         first = hashmap_get(c->by_key, i->key);
         if (first) {
-                _cleanup_(dns_resource_key_unrefp) DnsResourceKey *k = NULL;
+                _unused_ _cleanup_(dns_resource_key_unrefp) DnsResourceKey *k = NULL;
 
                 /* Keep a reference to the original key, while we manipulate the list. */
                 k = dns_resource_key_ref(first->key);
index 7f341986d93a59045334566cdd9d7a3e143bc118..3b5e456db2e06fb8a6e2e7da25b92f983d96f820 100644 (file)
@@ -165,7 +165,7 @@ static int dns_query_candidate_add_transaction(
 }
 
 static int dns_query_candidate_go(DnsQueryCandidate *c) {
-        _cleanup_(dns_query_candidate_unrefp) DnsQueryCandidate *keep_c = NULL;
+        _unused_ _cleanup_(dns_query_candidate_unrefp) DnsQueryCandidate *keep_c = NULL;
         DnsTransaction *t;
         int r;
         unsigned n = 0;
index aabaa266e99cef9a3e8f2d2a9d6473f55ddda762..85ab917c4fa9d922f570342c8336ec0b479e8200 100644 (file)
@@ -23,7 +23,7 @@
 
 static int run(int argc, char *argv[]) {
         _cleanup_(manager_freep) Manager *m = NULL;
-        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         int r;
 
         log_setup();
index 2864c1b8f9026051c9e8f9d952874ce98cdd939f..87061f55d7ed9ffd45ca7f0e6bf52aa8da76649e 100644 (file)
@@ -90,7 +90,7 @@
  * Returns: 0 on success, negative error code on failure.
  */
 int barrier_create(Barrier *b) {
-        _cleanup_(barrier_destroyp) Barrier *staging = b;
+        _unused_ _cleanup_(barrier_destroyp) Barrier *staging = b;
         int r;
 
         assert(b);
index b788b06913dd90fe5b229fbc06019b8ca0d7570d..c3e717ae11e63e0238c208b9d3aee6a070ff53f4 100644 (file)
@@ -81,7 +81,7 @@ int make_inaccessible_nodes(
                 { "inaccessible/blk",  S_IFBLK  | 0000 },
         };
 
-        _cleanup_umask_ mode_t u;
+        _unused_ _cleanup_umask_ mode_t u;
         int r;
 
         if (!parent_dir)
index fee5bd1c95fbdedcc8ae04ce4b04209415a90e00..f2f53380adfbf8e9c716e81152973589f3520a44 100644 (file)
@@ -25,7 +25,7 @@
 #include "utmp-wtmp.h"
 
 int utmp_get_runlevel(int *runlevel, int *previous) {
-        _cleanup_(utxent_cleanup) bool utmpx = false;
+        _unused_ _cleanup_(utxent_cleanup) bool utmpx = false;
         struct utmpx *found, lookup = { .ut_type = RUN_LVL };
         const char *e;
 
@@ -87,7 +87,7 @@ static void init_entry(struct utmpx *store, usec_t t) {
 }
 
 static int write_entry_utmp(const struct utmpx *store) {
-        _cleanup_(utxent_cleanup) bool utmpx = false;
+        _unused_ _cleanup_(utxent_cleanup) bool utmpx = false;
 
         assert(store);
 
@@ -215,7 +215,7 @@ int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line
 }
 
 int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
-        _cleanup_(utxent_cleanup) bool utmpx = false;
+        _unused_ _cleanup_(utxent_cleanup) bool utmpx = false;
         struct utmpx lookup = {
                 .ut_type = INIT_PROCESS /* looks for DEAD_PROCESS, LOGIN_PROCESS, USER_PROCESS, too */
         }, store, store_wtmp, *found;
@@ -340,7 +340,7 @@ int utmp_wall(
         bool (*match_tty)(const char *tty, void *userdata),
         void *userdata) {
 
-        _cleanup_(utxent_cleanup) bool utmpx = false;
+        _unused_ _cleanup_(utxent_cleanup) bool utmpx = false;
         _cleanup_free_ char *text = NULL, *hn = NULL, *un = NULL, *stdin_tty = NULL;
         struct utmpx *u;
         int r;
index 179562696d2dd4206566799a7de91c1fe13488c9..94e99b42de054fb8bf23b998d34fecd460082423 100644 (file)
@@ -87,7 +87,7 @@ settime:
 
 static int run(int argc, char *argv[]) {
         _cleanup_(manager_freep) Manager *m = NULL;
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         const char *user = "systemd-timesync";
         uid_t uid, uid_current;
         gid_t gid;
index 7699bad9e048218a09b6be1360e872f8d60c2739..839df8d6d29566687fc3466b09f109f11b896c05 100644 (file)
@@ -338,7 +338,8 @@ static int process_and_watch_password_files(bool watch) {
                 _FD_MAX
         };
 
-        _cleanup_close_ int notify = -1, signal_fd = -1, tty_block_fd = -1;
+        _unused_ _cleanup_close_ int tty_block_fd = -1;
+        _cleanup_close_ int notify = -1, signal_fd = -1;
         struct pollfd pollfd[_FD_MAX];
         sigset_t mask;
         int r;
index df720898ea1044f4c8d368c1846df4c944b80044..6df580d629a1f5dcef7bccdcd09489ef83a3c314 100644 (file)
@@ -1136,7 +1136,8 @@ static int on_ctrl_msg(UdevCtrl *uctrl, UdevCtrlMessageType type, const UdevCtrl
                 manager_reload(manager);
                 break;
         case UDEV_CTRL_SET_ENV: {
-                _cleanup_free_ char *key = NULL, *val = NULL, *old_key = NULL, *old_val = NULL;
+                _unused_ _cleanup_free_ char *old_val = NULL;
+                _cleanup_free_ char *key = NULL, *val = NULL, *old_key = NULL;
                 const char *eq;
 
                 eq = strchr(value->buf, '=');
index d469411eb82e1f12596ee8c42639980a2b4c4a2c..0c321bf41197dffe087301d471cdad3dbcc4537e 100644 (file)
@@ -24,7 +24,7 @@
 
 static int run(int argc, char *argv[]) {
         _cleanup_(manager_freep) Manager *m = NULL;
-        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         int r;
 
         log_setup();