Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing goto and fix tests #164

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions c/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- Fix an overflow in an internal flags value on platforms with
16 bit int types (:user:`jeromekelleher`, :issue:`153`, :pr:`153`).

- Fix a bug in which error conditions were not reported in append
mode if an error occured when closing the temporary file used
to read the data. (:user:`jeromekelleher`, :issue:`160`, :pr:`164`).

--------------------
[2.0.0] - 2020-05-23
--------------------
Expand Down
4 changes: 4 additions & 0 deletions c/io_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ test_append_fclose(void)
* places at which we can fail. */
_fclose_fail_at = 0;
_fclose_count = 0;
/* First fail is a special case, happens when closing the tmp file */
ret = kastore_open(&store, _tmp_file_name, "a", 0);
CU_ASSERT_EQUAL_FATAL(ret, KAS_ERR_IO);
_fclose_fail_at = 1;
done = false;
while (!done) {
ret = kastore_open(&store, _tmp_file_name, "a", 0);
Expand Down
1 change: 1 addition & 0 deletions c/kastore.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ kastore_open(kastore_t *self, const char *filename, const char *mode, int flags)
tmp.file = NULL;
if (err != 0) {
ret = KAS_ERR_IO;
goto out;
}
}
file = fopen(filename, file_mode);
Expand Down