Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #275 from MathieuBordere/probe-errors
Browse files Browse the repository at this point in the history
uv_fs: More clear errmsg when UvFsProbeCapabilities fails
  • Loading branch information
stgraber committed May 5, 2022
2 parents 1b5efd4 + fc4fecd commit 668ccc1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/uv_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ int UvFsProbeCapabilities(const char *dir,
/* Check if we can use direct I/O. */
rv = probeDirectIO(fd, direct, errmsg);
if (rv != 0) {
ErrMsgWrapf(errmsg, "probe Direct I/O");
goto err_after_file_open;
}

Expand All @@ -795,6 +796,7 @@ int UvFsProbeCapabilities(const char *dir,
}
rv = probeAsyncIO(fd, *direct, async, errmsg);
if (rv != 0) {
ErrMsgWrapf(errmsg, "probe Async I/O");
goto err_after_file_open;
}
#endif /* RWF_NOWAIT */
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_uv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ TEST(init, oom, setUp, tearDown, 0, oomParams)
return MUNIT_SKIP;
#endif
HEAP_FAULT_ENABLE;
INIT_ERROR(f->dir, RAFT_NOMEM, "out of memory");
INIT_ERROR(f->dir, RAFT_NOMEM, "probe Direct I/O: out of memory");
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_uv_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ TEST(UvFsProbeCapabilities, noResources, DirBtrfsSetUp, DirTearDown, 0, NULL)
return MUNIT_SKIP;
}
PROBE_CAPABILITIES_ERROR(dir, RAFT_IOERR,
"io_setup: resource temporarily unavailable");
"probe Async I/O: io_setup: resource temporarily unavailable");
AioDestroy(ctx);
return MUNIT_OK;
}
Expand Down

0 comments on commit 668ccc1

Please sign in to comment.