void aio_read_test_data(rbd_image_t image, const char *expected, uint64_t off, size_t len)
{
rbd_completion_t comp;
- char *result;
- assert((result = malloc(sizeof(result) * (len + 1))) != 0);
+ char *result = malloc(sizeof(result) * (len + 1));
+ assert(result);
rbd_aio_create_completion(NULL, (rbd_callback_t) simple_read_cb, &comp);
printf("created completion\n");
rbd_aio_read(image, off, len, result, comp);
void read_test_data(rbd_image_t image, const char *expected, uint64_t off, size_t len)
{
ssize_t read;
- char *result;
- assert((result = malloc(sizeof(result) * (len + 1))) != 0);
+ char *result = malloc(sizeof(result) * (len + 1));
+ assert(result);
read = rbd_read(image, off, len, result);
printf("read: %d\n", (int) read);
assert(read == (ssize_t)len);