[libvirt] [PATCH 1/9] util: make return value of virUUIDFormat and virMacAddrFormat useful

Laine Stump laine at laine.org
Mon Aug 6 05:43:42 UTC 2012


On 08/05/2012 12:24 PM, Doug Goldstein wrote:
> On Aug 5, 2012, at 12:16 AM, Laine Stump <laine at laine.org> wrote:
>
>> Both of these functions returned void, but it's convenient for them to
>> return a const char* of the char* that is passed in. This was you can
>> call the function and use the result in the same expression/arg.
>> ---
>> src/util/uuid.c       | 4 +++-
>> src/util/uuid.h       | 6 +++---
>> src/util/virmacaddr.c | 6 ++++--
>> src/util/virmacaddr.h | 4 ++--
>> 4 files changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/src/util/uuid.c b/src/util/uuid.c
>> index 1efde69..be4b13a 100644
>> --- a/src/util/uuid.c
>> +++ b/src/util/uuid.c
>> @@ -184,7 +184,8 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid) {
>>  *
>>  * Returns 0 in case of success and -1 in case of error.
>>  */
>> -void virUUIDFormat(const unsigned char *uuid, char *uuidstr)
>> +const char *
>> +virUUIDFormat(const unsigned char *uuid, char *uuidstr)
>> {
> The comment above the function says it returns 0 on success and -1 on error. Probably should be updated to match what it does now.

Good point, I didn't notice that. Just because it was wrong before,
doesn't mean it should continue to be wrong :-)




More information about the libvir-list mailing list