# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1208390152 25200
# Node ID 7c49e519c188c83b2c53866101eb64900fb41fd2
# Parent 609d9eb2ab4dec6611d856746a12d1e8f25e1963
Add const to variable in _net_rand_mac()
Saw compile issues with gcc-4.3.0-6. Unfortunately, this makes less succinct.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 609d9eb2ab4d -r 7c49e519c188 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Wed Apr 16 15:24:36 2008 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c Wed Apr 16 16:55:52 2008 -0700
@@ -438,14 +438,15 @@
int r;
int ret;
unsigned int s;
- char *mac = NULL;
+ char *tmp_mac = NULL;
+ const char *mac = NULL;
CMPIString *str = NULL;
CMPIStatus status;
srand(time(NULL));
r = rand_r(&s);
- ret = asprintf(&mac,
+ ret = asprintf(&tmp_mac,
"%s:%02x:%02x:%02x",
DEFAULT_MAC_PREFIX,
r & 0xFF,
@@ -455,14 +456,14 @@
if (ret == -1)
goto out;
- str = CMNewString(_BROKER, mac, &status);
+ str = CMNewString(_BROKER, tmp_mac, &status);
if ((str == NULL) || (status.rc != CMPI_RC_OK)) {
str = NULL;
CU_DEBUG("Failed to create string");
goto out;
}
out:
- free(mac);
+ free(tmp_mac);
if (str != NULL)
mac = CMGetCharPtr(str);
Show replies by date