Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jun 13, 2016
1 parent 995ebc5 commit c1df0fb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/clib/pio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,18 +562,23 @@ int PIOc_sync(int ncid)
if (file->mode & PIO_WRITE)
{
// cn_buffer_report( *ios, true);
wmb = &(file->buffer);
while(wmb != NULL){
wmb = &file->buffer;
while(wmb)
{
// printf("%s %d %d %d\n",__FILE__,__LINE__,wmb->ioid, wmb->validvars);
if(wmb->validvars>0){
if (wmb->validvars > 0)
{
flush_buffer(ncid, wmb, true);
}
twmb = wmb;
wmb = wmb->next;
if(twmb == &(file->buffer)){
twmb->ioid=-1;
twmb->next=NULL;
}else{
if (twmb == &file->buffer)
{
twmb->ioid = -1;
twmb->next = NULL;
}
else
{
brel(twmb);
}
}
Expand Down

0 comments on commit c1df0fb

Please sign in to comment.