- /* we still have "ret == TDB_ERR_IO" here */
- if (tdb1_write_all(tdb->file->fd, newdb, size))
- ret = TDB_SUCCESS;
+ if (!tdb1_write_all(tdb->file->fd, newdb, size)) {
+ ret = tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_ERROR,
+ "tdb1_new_database: write failed");
+ goto fail;
+ }
+ ret = TDB_SUCCESS;