fails, leaking various structures including repl walkers.
/*
- * $Id: store_dir_aufs.cc,v 1.17 2000/11/30 20:07:32 wessels Exp $
+ * $Id: store_dir_aufs.cc,v 1.18 2000/11/30 20:08:47 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
struct stat sb;
sd->log.clean.write = NULL;
sd->log.clean.state = NULL;
+ state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC);
+ if (state->fd < 0) {
+ xfree(state);
+ return -1;
+ }
state->cur = xstrdup(storeAufsDirSwapLogFile(sd, NULL));
state->new = xstrdup(storeAufsDirSwapLogFile(sd, ".clean"));
state->cln = xstrdup(storeAufsDirSwapLogFile(sd, ".last-clean"));
state->walker = sd->repl->WalkInit(sd->repl);
unlink(state->new);
unlink(state->cln);
- state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC);
- if (state->fd < 0)
- return -1;
debug(20, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n",
state->new, state->fd);
#if HAVE_FCHMOD
/*
- * $Id: store_dir_coss.cc,v 1.9 2000/11/02 18:34:48 wessels Exp $
+ * $Id: store_dir_coss.cc,v 1.10 2000/11/30 20:08:50 wessels Exp $
*
* DEBUG: section 81 Store COSS Directory Routines
* AUTHOR: Eric Stern
CossInfo *cs = (CossInfo *) sd->fsdata;
struct _clean_state *state = xcalloc(1, sizeof(*state));
struct stat sb;
+ state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC);
+ if (state->fd < 0) {
+ xfree(state);
+ return -1;
+ }
sd->log.clean.write = NULL;
sd->log.clean.state = NULL;
state->cur = xstrdup(storeCossDirSwapLogFile(sd, NULL));
state->outbuf_offset = 0;
unlink(state->new);
unlink(state->cln);
- state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC);
- if (state->fd < 0)
- return -1;
state->current = cs->index.tail;
debug(20, 3) ("storeCOssDirWriteCleanLogs: opened %s, FD %d\n",
state->new, state->fd);
/*
- * $Id: store_dir_diskd.cc,v 1.25 2000/11/30 20:07:32 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.26 2000/11/30 20:08:50 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
struct stat sb;
sd->log.clean.write = NULL;
sd->log.clean.state = NULL;
+ state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC);
+ if (state->fd < 0) {
+ xfree(state);
+ return -1;
+ }
state->cur = xstrdup(storeDiskdDirSwapLogFile(sd, NULL));
state->new = xstrdup(storeDiskdDirSwapLogFile(sd, ".clean"));
state->cln = xstrdup(storeDiskdDirSwapLogFile(sd, ".last-clean"));
/*
- * $Id: store_dir_ufs.cc,v 1.15 2000/11/30 20:07:33 wessels Exp $
+ * $Id: store_dir_ufs.cc,v 1.16 2000/11/30 20:08:51 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
struct stat sb;
sd->log.clean.write = NULL;
sd->log.clean.state = NULL;
+ state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC);
+ if (state->fd < 0) {
+ xfree(state);
+ return -1;
+ }
state->cur = xstrdup(storeUfsDirSwapLogFile(sd, NULL));
state->new = xstrdup(storeUfsDirSwapLogFile(sd, ".clean"));
state->cln = xstrdup(storeUfsDirSwapLogFile(sd, ".last-clean"));
state->walker = sd->repl->WalkInit(sd->repl);
unlink(state->new);
unlink(state->cln);
- state->fd = file_open(state->new, O_WRONLY | O_CREAT | O_TRUNC);
- if (state->fd < 0)
- return -1; /* state not free'd - possible leak */
debug(20, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n",
state->new, state->fd);
#if HAVE_FCHMOD