From 2746998859717b9b06fe026f906bcd696a1aeba1 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 29 Aug 2014 20:14:33 +0200 Subject: [PATCH] uuid: don't terminate app on an error --- src/uuid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uuid.c b/src/uuid.c index 959fc185..3ed96de8 100644 --- a/src/uuid.c +++ b/src/uuid.c @@ -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; }