Commit 5c2f1546 authored by Philip Carns's avatar Philip Carns
Browse files

should have been in previous commit

parent 718b5ca1
......@@ -206,42 +206,45 @@ static void worker_ult(void *_arg)
sprintf(template, "./data-XXXXXX");
if(arg->opt_abt_io)
if(arg->opt_io)
{
fd = abt_io_mkostemp(arg->aid, template, O_DIRECT|O_SYNC);
if(fd < 0)
if(arg->opt_abt_io)
{
fprintf(stderr, "abt_io_mkostemp: %d\n", fd);
}
assert(fd >= 0);
fd = abt_io_mkostemp(arg->aid, template, O_DIRECT|O_SYNC);
if(fd < 0)
{
fprintf(stderr, "abt_io_mkostemp: %d\n", fd);
}
assert(fd >= 0);
ret = abt_io_pwrite(arg->aid, fd, buffer, arg->opt_unit_size, 0);
assert(ret == arg->opt_unit_size);
ret = abt_io_pwrite(arg->aid, fd, buffer, arg->opt_unit_size, 0);
assert(ret == arg->opt_unit_size);
ret = abt_io_close(arg->aid, fd);
assert(ret == 0);
ret = abt_io_close(arg->aid, fd);
assert(ret == 0);
ret = abt_io_unlink(arg->aid, template);
assert(ret == 0);
}
else
{
fd = mkostemp(template, O_DIRECT|O_SYNC);
if(fd < 0)
{
perror("mkostemp");
fprintf(stderr, "errno: %d\n", errno);
ret = abt_io_unlink(arg->aid, template);
assert(ret == 0);
}
assert(fd >= 0);
ret = pwrite(fd, buffer, arg->opt_unit_size, 0);
assert(ret == arg->opt_unit_size);
ret = close(fd);
assert(ret == 0);
else
{
fd = mkostemp(template, O_DIRECT|O_SYNC);
if(fd < 0)
{
perror("mkostemp");
fprintf(stderr, "errno: %d\n", errno);
}
assert(fd >= 0);
ret = pwrite(fd, buffer, arg->opt_unit_size, 0);
assert(ret == arg->opt_unit_size);
ret = close(fd);
assert(ret == 0);
ret = unlink(template);
assert(ret == 0);
ret = unlink(template);
assert(ret == 0);
}
}
free(buffer);
......
Markdown is supported
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