Chameleon

Chameleon Commit Details

Date:2010-02-14 15:56:09 (14 years 1 month ago)
Author:JrCs
Commit:78
Parents: 77
Message:Rewrite getUUIDFromString to newUUIDFromString
Changes:
M/branches/JrCs/i386/libsaio/convert.c
M/branches/JrCs/i386/libsaio/convert.h
M/branches/JrCs/i386/libsaio/fake_efi.c

File differences

branches/JrCs/i386/libsaio/convert.c
2121
2222
2323
24
25
24
25
26
27
2628
2729
2830
2931
3032
3133
32
34
35
3336
3437
3538
......
4851
4952
5053
51
54
55
56
57
58
5259
5360
5461
return msg;
}
/** Parse an UUID string into an (EFI_CHAR8*) buffer */
EFI_CHAR8* getUUIDFromString(const char *source)
/* Parse an UUID string into an (EFI_CHAR8*) buffer
* Return a new allocated uuid
*/
EFI_CHAR8* newUUIDFromString(const char *source)
{
if (! source) return NULL;
char* p = (char*) source;
int i;
char buf[3];
static EFI_CHAR8 uuid[UUID_LEN+1]="";
EFI_CHAR8 uuid[UUID_LEN+1];
EFI_CHAR8* result;
buf[2] = '\0';
for (i=0; i < UUID_LEN; i++) {
if (*p != '\0') {
return NULL;
}
return uuid;
result = malloc(UUID_LEN+1);
bcopy(uuid, result, UUID_LEN+1);
return result;
}
/** XXX AsereBLN replace by strtoul */
branches/JrCs/i386/libsaio/convert.h
1212
1313
1414
15
15
1616
1717
1818
#define UUID_LEN 16
const char * getStringFromUUID(const EFI_CHAR8* uuid);
EFI_CHAR8* getUUIDFromString(const char *source);
EFI_CHAR8* newUUIDFromString(const char *source);
void *convertHexStr2Binary(const char *hexStr, int *outLength);
uint32_t ascii_hex_to_int(char *buff);
branches/JrCs/i386/libsaio/fake_efi.c
334334
335335
336336
337
338337
339338
340
341
339
340
342341
343342
344343
345344
346345
347
346
348347
349348
350349
*/
static const EFI_CHAR8* getSystemID()
{
bool pause = FALSE;
int len;
const char* StrSystemId = NULL;
const EFI_CHAR8* SystemId = NULL;
const char* StrSystemId = NULL;
const EFI_CHAR8* SystemId = NULL;
// unable to determine UUID for host. Error: 35 fix
getValueForKey(kSystemID, &StrSystemId, &len, &bootInfo->bootConfig);
if (StrSystemId != NULL) {
SystemId = getUUIDFromString(StrSystemId);
SystemId = newUUIDFromString(StrSystemId);
if (SystemId == NULL) {
error("Error: invalid SystemID '%s'\n", StrSystemId);
pause = TRUE;

Archive Download the corresponding diff file

Revision: 78