1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

sheepdog: Adjust logic to break while loop to avoid Coverity error

Change the various "return -1" to "break".  Avoids Coverity error and
perhaps other/future analyzer issues.
This commit is contained in:
John Ferlan 2013-03-05 07:28:04 -05:00
parent 40e904490f
commit 80e524de86

View File

@ -66,7 +66,7 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
if ((next = strchr(p, '\n'))) if ((next = strchr(p, '\n')))
++next; ++next;
else else
return -1; break;
if (!STRPREFIX(p, "Total ")) if (!STRPREFIX(p, "Total "))
continue; continue;
@ -74,13 +74,13 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
p = p + 6; p = p + 6;
if (virStrToLong_ull(p, &end, 10, &pool->capacity) < 0) if (virStrToLong_ull(p, &end, 10, &pool->capacity) < 0)
return -1; break;
if ((p = end + 1) > next) if ((p = end + 1) > next)
return -1; break;
if (virStrToLong_ull(p, &end, 10, &pool->allocation) < 0) if (virStrToLong_ull(p, &end, 10, &pool->allocation) < 0)
return -1; break;
pool->available = pool->capacity - pool->allocation; pool->available = pool->capacity - pool->allocation;
return 0; return 0;