"Write to read-only database");
}
- /* FIXME: Bogus optimization? */
- if (len == 0) {
- return TDB_SUCCESS;
- }
-
ecode = tdb->methods->oob(tdb, off + len, 0);
if (ecode != TDB_SUCCESS) {
return ecode;
} else {
ssize_t ret;
ret = pwrite(tdb->fd, buf, len, off);
- if (ret < len) {
+ if (ret != len) {
/* This shouldn't happen: we avoid sparse files. */
if (ret >= 0)
errno = ENOSPC;
while (len) {
size_t n = len > size ? size : len;
ssize_t ret = pwrite(tdb->fd, buf, n, off);
- if (ret < n) {
+ if (ret != n) {
if (ret >= 0)
errno = ENOSPC;