summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-08-30 03:18:33 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-09-01 18:20:13 +0200
commit64d6c22905e94b02e760747c6c143dc9893083d9 (patch)
tree54722775e9dd947f4d6b0633e40dad00e1f476fb
parent40ec276fdfc98f9fa7ed155b906235a79711066d (diff)
tree-wide: do not shadow the global var timezone
-rw-r--r--src/basic/time-util.c4
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c6
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c8
-rw-r--r--src/network/networkctl.c8
-rw-r--r--src/network/networkd-link.c8
-rw-r--r--src/network/networkd-network.c6
6 files changed, 20 insertions, 20 deletions
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index afc6a6eb24..531931f6e1 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -1046,7 +1046,7 @@ clockid_t clock_boottime_or_monotonic(void) {
return clock;
}
-int get_timezone(char **timezone) {
+int get_timezone(char **tz) {
_cleanup_free_ char *t = NULL;
const char *e;
char *z;
@@ -1069,6 +1069,6 @@ int get_timezone(char **timezone) {
if (!z)
return -ENOMEM;
- *timezone = z;
+ *tz = z;
return 0;
}
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index 6551e7c94c..aa07846693 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -1121,13 +1121,13 @@ int dhcp_lease_set_client_id(sd_dhcp_lease *lease, const void *client_id, size_t
return 0;
}
-int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **timezone) {
+int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **tz) {
assert_return(lease, -EINVAL);
- assert_return(timezone, -EINVAL);
+ assert_return(tz, -EINVAL);
if (!lease->timezone)
return -ENODATA;
- *timezone = lease->timezone;
+ *tz = lease->timezone;
return 0;
}
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index 89b9a4c6be..b96cee4830 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -1037,16 +1037,16 @@ int sd_dhcp_server_forcerenew(sd_dhcp_server *server) {
return r;
}
-int sd_dhcp_server_set_timezone(sd_dhcp_server *server, const char *timezone) {
+int sd_dhcp_server_set_timezone(sd_dhcp_server *server, const char *tz) {
int r;
assert_return(server, -EINVAL);
- assert_return(timezone_is_valid(timezone), -EINVAL);
+ assert_return(timezone_is_valid(tz), -EINVAL);
- if (streq_ptr(timezone, server->timezone))
+ if (streq_ptr(tz, server->timezone))
return 0;
- r = free_and_strdup(&server->timezone, timezone);
+ r = free_and_strdup(&server->timezone, tz);
if (r < 0)
return r;
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 d797a8ded8..82bd727c3a 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -980,14 +980,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.");
@@ -1004,7 +1004,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;
}