- /* try once more */
- tdb->ecode = TDB1_ERR_IO;
- TDB1_LOG((tdb, TDB1_DEBUG_FATAL, "tdb1_write: wrote only "
- "%d of %d bytes at %d, trying once more\n",
- (int)written, len, off));
- written = pwrite(tdb->fd, (const char *)buf+written,
+ tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_WARNING,
+ "tdb1_write: wrote only "
+ "%d of %d bytes at %d, trying once more",
+ (int)written, len, off);
+ written = pwrite(tdb->file->fd,
+ (const char *)buf+written,