Skip to content

Commit

Permalink
fix a+ w+ handling typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed Jun 29, 2020
1 parent f7d762c commit ca6297c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
16 changes: 8 additions & 8 deletions src/bigfile-mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,7 @@ big_file_mpi_create_records(BigFile * bf,
int i;
for(i = 0; i < rtype->nfield; i ++) {
BigBlock block[1];
if (0 != strcmp(mode, "w+")) {
RAISEIF(0 != big_file_mpi_open_block(bf, block, rtype->fields[i].name, comm),
ex_open,
NULL);
RAISEIF(0 != big_block_mpi_grow(block, Nfile, fsize, comm),
ex_grow,
NULL);
} else if (0 != strcmp(mode, "a+")) {
if (0 == strcmp(mode, "w+")) {
RAISEIF(0 != _big_file_mpi_create_block(bf, block,
rtype->fields[i].name,
rtype->fields[i].dtype,
Expand All @@ -591,6 +584,13 @@ big_file_mpi_create_records(BigFile * bf,
comm),
ex_open,
NULL);
} else if (0 == strcmp(mode, "a+")) {
RAISEIF(0 != big_file_mpi_open_block(bf, block, rtype->fields[i].name, comm),
ex_open,
NULL);
RAISEIF(0 != big_block_mpi_grow(block, Nfile, fsize, comm),
ex_grow,
NULL);
} else {
RAISE(ex_open,
"Mode string must be `a+` or `w+`, `%s` provided",
Expand Down
4 changes: 2 additions & 2 deletions src/bigfile-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ big_file_create_records(BigFile * bf,
int i;
for(i = 0; i < rtype->nfield; i ++) {
BigBlock block[1];
if (0 != strcmp(mode, "w+")) {
if (0 == strcmp(mode, "w+")) {
RAISEIF(0 != big_file_create_block(bf, block,
rtype->fields[i].name,
rtype->fields[i].dtype,
Expand All @@ -130,7 +130,7 @@ big_file_create_records(BigFile * bf,
fsize),
ex_open,
NULL);
} else if (0 != strcmp(mode, "a+")) {
} else if (0 == strcmp(mode, "a+")) {
RAISEIF(0 != big_file_open_block(bf, block, rtype->fields[i].name),
ex_open,
NULL);
Expand Down
3 changes: 2 additions & 1 deletion src/bigfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,8 @@ big_block_seek(BigBlock * bb, BigBlockPtr * ptr, ptrdiff_t offset)
ex_eof,
/* over the end of file */
/* note that we allow seeking at the end of file */
"Over the end of file");
"Over the end of file %td of %td",
offset, bb->size);
{
int left = 0;
int right = bb->Nfile;
Expand Down

0 comments on commit ca6297c

Please sign in to comment.