diff options
author | Eric Lambert <eric.lambert@seagate.com> | 2014-09-26 19:13:37 -0700 |
---|---|---|
committer | Eric Lambert <eric.d.lambert@gmail.com> | 2014-09-26 19:13:37 -0700 |
commit | 3a108f751cd522fb30f348ff8968caeef7f6f9b8 (patch) | |
tree | 493ecaa2b5dc95f8cc52ab3cb2665989cf1c018e /src/erasurecode.c | |
parent | 06bb20ca1c9c7800ca3633ca1447deab68a5f0a4 (diff) | |
download | liberasurecode-newapi.tar.gz |
liberasurecode_backend_lookup_id now returns EC_BACKENDS_MAX, asnewapi
opposed to -1, when it can not locate the specified backend (-1
was a non-sensical return value since the function signature
called for a type of ec_backend_id_t). NOTE: with this change we
now successfully build and tests pass on OS X with clang.
Diffstat (limited to 'src/erasurecode.c')
-rw-r--r-- | src/erasurecode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/erasurecode.c b/src/erasurecode.c index b376568..0d7e563 100644 --- a/src/erasurecode.c +++ b/src/erasurecode.c @@ -81,7 +81,7 @@ ec_backend_t liberasurecode_backend_lookup_by_name(const char *name) ec_backend_id_t liberasurecode_backend_lookup_id(const char *name) { if (NULL == name) - return -1; + return EC_BACKENDS_MAX; int b = 0; for (b = 0; ec_backends_supported[b]; ++b) { @@ -90,7 +90,7 @@ ec_backend_id_t liberasurecode_backend_lookup_id(const char *name) return backend->common.id; } - return -1; + return EC_BACKENDS_MAX; } /* =~=*=~==~=*=~==~=*=~= EC backend instance management =~=*=~==~=*=~==~=*= */ @@ -313,7 +313,7 @@ int liberasurecode_instance_create(const char *backend_name, return -1; ec_backend_id_t id = liberasurecode_backend_lookup_id(backend_name); - if (-1 == id) + if (EC_BACKENDS_MAX == id) return -EBACKENDNOTSUPP; /* Allocate memory for ec_backend instance */ |