summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2015-09-01 18:33:54 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2015-09-01 18:33:54 +0200
commit3a487d41d79b8c24ae6e9b8e86b36bed07f2c20b (patch)
treec5225b37b1fdb4cb66ad955f4385dc842c7fcd08 /src/network
parent3f010fe095a8070299d35f0f9d386672e0cb2af0 (diff)
parent64d6c22905e94b02e760747c6c143dc9893083d9 (diff)
Merge pull request #1108 from phomes/dont-shadow-globals
tree-wide: do not shadow the global var timezone
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkctl.c8
-rw-r--r--src/network/networkd-link.c8
-rw-r--r--src/network/networkd-network.c6
3 files changed, 11 insertions, 11 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 2281d4b718..786579def0 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -497,7 +497,7 @@ static int link_status_one(
sd_hwdb *hwdb,
const char *name) {
_cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **domains = NULL;
- _cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *timezone = NULL;
+ _cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *tz = NULL;
_cleanup_netlink_message_unref_ sd_netlink_message *req = NULL, *reply = NULL;
_cleanup_device_unref_ sd_device *d = NULL;
char devid[2 + DECIMAL_STR_MAX(int)];
@@ -662,9 +662,9 @@ static int link_status_one(
if (!strv_isempty(carrier_bound_by))
dump_list("Carrier Bound By: ", carrier_bound_by);
- (void) sd_network_link_get_timezone(ifindex, &timezone);
- if (timezone)
- printf(" Time Zone: %s", timezone);
+ (void) sd_network_link_get_timezone(ifindex, &tz);
+ if (tz)
+ printf(" Time Zone: %s", tz);
return 0;
}
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 979f3115f6..1dc9db0fca 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -967,14 +967,14 @@ static int set_timezone_handler(sd_bus_message *m, void *userdata, sd_bus_error
return 1;
}
-int link_set_timezone(Link *link, const char *timezone) {
+int link_set_timezone(Link *link, const char *tz) {
int r;
assert(link);
assert(link->manager);
- assert(timezone);
+ assert(tz);
- log_link_debug(link, "Setting system timezone: '%s'", timezone);
+ log_link_debug(link, "Setting system timezone: '%s'", tz);
if (!link->manager->bus) {
log_link_info(link, "Not connected to system bus, ignoring timezone.");
@@ -991,7 +991,7 @@ int link_set_timezone(Link *link, const char *timezone) {
set_timezone_handler,
link,
"sb",
- timezone,
+ tz,
false);
if (r < 0)
return log_link_error_errno(link, r, "Could not set timezone: %m");
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 2a77242013..ee14401982 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -786,7 +786,7 @@ int config_parse_timezone(
void *data,
void *userdata) {
- char **timezone = data, *tz = NULL;
+ char **datap = data, *tz = NULL;
int r;
assert(filename);
@@ -803,8 +803,8 @@ int config_parse_timezone(
return 0;
}
- free(*timezone);
- *timezone = tz;
+ free(*datap);
+ *datap = tz;
return 0;
}