Changeset cdb26b49e531703260a05d626a2e65335ad2d8db

Show
Ignore:
Timestamp:
10/23/09 00:39:43 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1256258383 +0000
git-parent:

[a51617dcb0862b0336f39d7de478b5837666a2f5]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1256258383 +0000
Message:

leaking filedescriptor issue, refs #150

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_datastore.c

    r2fa2fac rcdb26b4  
    953953  ds_line_detail *head = NULL, *last = NULL, *next = NULL; 
    954954 
     955  if(ij->fd < 0) { 
     956    ij->fd = open(ij->filename, O_RDONLY); 
     957    if(ij->fd < 0) { 
     958      noitL(noit_error, "Cannot open interim journal '%s': %s\n", 
     959            ij->filename, strerror(errno)); 
     960      assert(ij->fd >= 0); 
     961    } 
     962  } 
    955963  while((rv = fstat(ij->fd, &st)) == -1 && errno == EINTR); 
    956964  assert(rv != -1); 
     
    974982  } 
    975983  munmap((void *)buff, len); 
     984  close(ij->fd); 
    976985  return head; 
    977986} 
     
    10781087          ij->remote_str, ij->remote_cn, ij->fqdn); 
    10791088    fsync(ij->fd); 
     1089    close(ij->fd); 
     1090    ij->fd = -1; 
    10801091    ingest = eventer_alloc(); 
    10811092    ingest->mask = EVENTER_ASYNCH; 
     
    14101421    return; 
    14111422  } 
     1423  close(ij->fd); 
     1424  ij->fd = -1; 
    14121425  ij->filename = strdup(path); 
    14131426  ij->remote_str = strdup(remote_str); 
     
    14161429  ij->cpool = get_conn_pool_for_remote(ij->remote_str, ij->remote_cn, 
    14171430                                       ij->fqdn); 
    1418  
    14191431  noitL(noit_error, "ingesting old payload: %s\n", ij->filename); 
    14201432  ingest = eventer_alloc();