uuid: don't terminate app on an error

This commit is contained in:
Jaroslav Kysela 2014-08-29 20:14:33 +02:00
parent 4ce05e56a7
commit 2746998859

View file

@ -109,12 +109,12 @@ uuid_init_bin ( tvh_uuid_t *u, const char *str )
if (str) {
if (strlen(str) != UUID_HEX_SIZE - 1) {
tvherror("uuid", "wrong uuid size");
exit(1);
return -EINVAL;
}
return hex2bin(u->bin, sizeof(u->bin), str);
} else if (read(fd, u->bin, sizeof(u->bin)) != sizeof(u->bin)) {
tvherror("uuid", "failed to read from %s", RANDOM_PATH);
exit(1);
return -EINVAL;
}
return 0;
}