Commit 348ef4c5 authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Correctly report TAO_BAD_BUFFERS

parent 3d38dfc4
......@@ -1281,7 +1281,7 @@ static tao_status check_configuration(
// Check number of number of acquisition buffers.
if (cfg->nbufs < 2) {
tao_store_error(func, TAO_BAD_SIZE);
tao_store_error(func, TAO_BAD_BUFFERS);
return TAO_ERROR;
}
return TAO_OK;
......
......@@ -33,7 +33,7 @@ tao_remote_camera* tao_remote_camera_create(
{
// Check arguments.
if (nbufs < 2) {
tao_store_error(__func__, TAO_BAD_SIZE);
tao_store_error(__func__, TAO_BAD_BUFFERS);
return NULL;
}
......
......@@ -108,7 +108,11 @@ tao_remote_mirror* tao_remote_mirror_create(
tao_store_error(__func__, TAO_BAD_ADDRESS);
return NULL;
}
if (nbufs < 2 || dim1 < 1 || dim2 < 1) {
if (nbufs < 2) {
tao_store_error(__func__, TAO_BAD_BUFFERS);
return NULL;
}
if (dim1 < 1 || dim2 < 1) {
tao_store_error(__func__, TAO_BAD_SIZE);
return NULL;
}
......
......@@ -59,7 +59,11 @@ tao_remote_object* tao_remote_object_create(
tao_store_error(__func__, TAO_BAD_TYPE);
return NULL;
}
if (nbufs < 0 || offset < sizeof(tao_remote_object) || stride < 0 ||
if (nbufs < 2) {
tao_store_error(__func__, TAO_BAD_BUFFERS);
return NULL;
}
if (offset < sizeof(tao_remote_object) || stride < 0 ||
size < offset + nbufs*stride) {
tao_store_error(__func__, TAO_BAD_SIZE);
return NULL;
......
......@@ -69,7 +69,7 @@ tao_framegrabber* tao_framegrabber_create(
return NULL;
}
if (nbufs < 2) {
tao_store_error(__func__, TAO_BAD_ARGUMENT);
tao_store_error(__func__, TAO_BAD_BUFFERS);
return NULL;
}
tao_framegrabber* fg = TAO_NEW(1, tao_framegrabber);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment