trivial: rename rand to avoid -Wshadow

This commit is contained in:
Pavel Šimerda
2013-04-02 10:41:05 +02:00
parent afc7f17191
commit eb2b990ddc

View File

@@ -353,7 +353,7 @@ generate_duid_from_machine_id (void)
gsize sumlen = sizeof (buffer); gsize sumlen = sizeof (buffer);
const guint16 duid_type = g_htons (4); const guint16 duid_type = g_htons (4);
uuid_t uuid; uuid_t uuid;
GRand *rand; GRand *generator;
guint i; guint i;
gboolean success = FALSE; gboolean success = FALSE;
@@ -380,10 +380,10 @@ generate_duid_from_machine_id (void)
"or " LOCALSTATEDIR "/lib/dbus/machine-id to generate " "or " LOCALSTATEDIR "/lib/dbus/machine-id to generate "
"DHCPv6 DUID; creating non-persistent random DUID."); "DHCPv6 DUID; creating non-persistent random DUID.");
rand = g_rand_new (); generator = g_rand_new ();
for (i = 0; i < sizeof (buffer) / sizeof (guint32); i++) for (i = 0; i < sizeof (buffer) / sizeof (guint32); i++)
((guint32 *) buffer)[i] = g_rand_int (rand); ((guint32 *) buffer)[i] = g_rand_int (generator);
g_rand_free (rand); g_rand_free (generator);
} }
/* Generate a DHCP Unique Identifier for DHCPv6 using the /* Generate a DHCP Unique Identifier for DHCPv6 using the