#undef DIRINFO_DEBUG
+#include "config.h"
#include "e2fsck.h"
#include <sys/stat.h>
#include <fcntl.h>
uuid_unparse(ctx->fs->super->s_uuid, uuid);
sprintf(db->tdb_fn, "%s/%s-dirinfo-XXXXXX", tdb_dir, uuid);
fd = mkstemp(db->tdb_fn);
+ if (fd < 0) {
+ db->tdb = NULL;
+ return;
+ }
db->tdb = tdb_open(db->tdb_fn, 0, TDB_CLEAR_IF_FIRST,
O_RDWR | O_CREAT | O_TRUNC, 0600);
close(fd);
iter = e2fsck_allocate_memory(ctx, sizeof(struct dir_info_iter),
"dir_info iterator");
- memset(iter, 0, sizeof(iter));
if (db->tdb)
iter->tdb_iter = tdb_firstkey(db->tdb);