
Kaitlin Rupert wrote:
Dan Smith wrote:
No, that case is still handled. For full context:
+ if (cu_get_str_prop(inst, "NetworkType", &val) != CMPI_RC_OK) + val = "bridge"; + free(dev->dev.net.type); - cu_get_str_prop(inst, "NetworkType", &dev->dev.net.type); - if (dev->dev.net.type == NULL) - dev->dev.net.type = strdup("bridge"); + dev->dev.net.type = strdup(val);
I moved the "not set" (NULL) case above, and set val to "bridge", so that below, I can assume it is a valid const string and strdup it directly. So val either gets the actual type, or "bridge" by the time I get to the strdup.
I did the same reordering in disk with the Address field, making "/dev/null" the default if unspecified. Oops.. thanks for the clarification. I caught the Address part, but I missed it for the NetworkType part. Looks good then. =)
-- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com