static int testrados(void)
{
char tmp[32];
- int i, r;
+ int i, r, safe;
int ret = 1; //set 1 as error case
rados_t cl;
+ const char *oid = "foo_object";
+ const char *exkeys[] = { "a", "b", "c", NULL };
+ const char *exvals[] = { "1", "2", "3", NULL };
if (rados_create(&cl, NULL) < 0) {
printf("error initializing\n");
char buf[128], buf2[128];
time(&tm);
snprintf(buf, 128, "%s", ctime(&tm));
- const char *oid = "foo_object";
r = rados_write(io_ctx, oid, buf, strlen(buf) + 1, 0);
printf("rados_write = %d\n", r);
r = rados_read(io_ctx, oid, buf2, sizeof(buf2), 0);
goto out_err_cleanup;
if (do_rados_getxattr(io_ctx, oid, "c", "3"))
goto out_err_cleanup;
- const char *exkeys[] = { "a", "b", "c", NULL };
- const char *exvals[] = { "1", "2", "3", NULL };
if (do_rados_getxattrs(io_ctx, oid, exkeys, exvals))
goto out_err_cleanup;
rados_completion_t c;
rados_aio_create_completion(0, 0, 0, &c);
rados_aio_write(io_ctx, "c", c, buf, 100, 0);
- int safe = rados_aio_is_safe(c);
+ safe = rados_aio_is_safe(c);
printf("a should not yet be safe and ... %s\n", safe ? "is":"is not");
assert(!safe);
rados_aio_flush(io_ctx);