]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Remove a bunch of unused variables
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Nov 2017 21:32:22 +0000 (22:32 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Nov 2017 22:06:44 +0000 (23:06 +0100)
gcc does not warn about those, because of the _cleanup_ usage.
clang is smarter here.

src/basic/terminal-util.c
src/core/dbus-execute.c
src/gpt-auto-generator/gpt-auto-generator.c
src/libsystemd/sd-bus/test-bus-benchmark.c
src/login/logind-session.c
src/network/networkd-routing-policy-rule.c
src/shared/path-lookup.c
src/test/test-fileio.c

index 28c8c35fe0f64d20acba2ad5fdc64779b81fbd25..fdf2b098f6164fdf084441abb665624c776e1c0f 100644 (file)
@@ -245,7 +245,6 @@ int ask_string(char **ret, const char *text, ...) {
 
 int reset_terminal_fd(int fd, bool switch_to_text) {
         struct termios termios;
-        _cleanup_free_ char *utf8 = NULL;
         int r = 0;
 
         /* Set terminal to some sane defaults */
index 26c6e039b859ba4c77efdfcea3bcfbef00bd4697..4dbd6b0f6f9aaa2fb9413d2f0b6fddf6106addbe 100644 (file)
@@ -1177,8 +1177,6 @@ int bus_exec_context_set_transient_property(
                         return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid personality");
 
                 if (mode != UNIT_CHECK) {
-                        _cleanup_free_ char *str = NULL;
-
                         c->personality = p;
                         unit_write_drop_in_private_format(u, mode, name, "%s=%s", name, s);
                 }
index ae0a8da63a9c033f35d7b4e16b0706b6e574ece0..f9a0a14d9e1c088be2837cac2bc83344a009f576 100644 (file)
@@ -56,7 +56,7 @@ static bool arg_root_enabled = true;
 static bool arg_root_rw = false;
 
 static int add_cryptsetup(const char *id, const char *what, bool rw, bool require, char **device) {
-        _cleanup_free_ char *e = NULL, *n = NULL, *p = NULL, *d = NULL, *to = NULL;
+        _cleanup_free_ char *e = NULL, *n = NULL, *p = NULL, *d = NULL;
         _cleanup_fclose_ FILE *f = NULL;
         char *ret;
         int r;
index 6f0ca47df6b4549a1d39e1b35c5fb0b52048bf12..2bb435b9760f8cf57618dfad2876324fc666c649 100644 (file)
@@ -228,7 +228,7 @@ int main(int argc, char *argv[]) {
         } mode = MODE_BISECT;
         Type type = TYPE_LEGACY;
         int i, pair[2] = { -1, -1 };
-        _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL, *server_name = NULL;
+        _cleanup_free_ char *address = NULL, *server_name = NULL;
         _cleanup_close_ int bus_ref = -1;
         const char *unique;
         cpu_set_t cpuset;
index 730acd2978df5c07dfded7a042fb491cfc3cb477..db4dc45e05ea5649417954c82cc6951197d34dd5 100644 (file)
@@ -1136,7 +1136,6 @@ void session_restore_vt(Session *s) {
                 .mode = VT_AUTO,
         };
 
-        _cleanup_free_ char *utf8 = NULL;
         int vt, old_fd;
 
         /* We need to get a fresh handle to the virtual terminal,
index 6850135fc11b48e094c4b7371bbe2aa9c184beef..d37f31a4cf561252aea5b91338e59c26a35b141e 100644 (file)
@@ -672,7 +672,6 @@ int config_parse_routing_policy_rule_fwmark_mask(
                 void *userdata) {
 
         _cleanup_routing_policy_rule_free_ RoutingPolicyRule *n = NULL;
-        _cleanup_free_ char *fwmark = NULL;
         Network *network = userdata;
         int r;
 
@@ -751,7 +750,7 @@ int config_parse_routing_policy_rule_prefix(
 }
 
 static int routing_policy_rule_read_full_file(char *state_file, char **ret) {
-        _cleanup_free_ char *s = NULL, *p = NULL;
+        _cleanup_free_ char *s = NULL;
         size_t size;
         int r;
 
index 802e4b9c8d828350c082858679bedc9b6b3eb095..26dbb482ef813f0e4c739e85c903eb47350ccd76 100644 (file)
@@ -245,7 +245,6 @@ static int acquire_generator_dirs(
                 char **generator_early,
                 char **generator_late) {
 
-        _cleanup_(rmdir_and_freep) char *t = NULL;
         _cleanup_free_ char *x = NULL, *y = NULL, *z = NULL;
         const char *prefix;
 
index 27495fa5be469f003e647fc32a661eeb88f33fba..c78eb51b429dd3fb5ef360b4523f4ce45a23d303 100644 (file)
@@ -704,7 +704,6 @@ static void test_read_line_one_file(FILE *f) {
 
 static void test_read_line(void) {
         _cleanup_fclose_ FILE *f = NULL;
-        _cleanup_free_ char *line = NULL;
 
         f = fmemopen((void*) buffer, sizeof(buffer), "re");
         assert_se(f);