} 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;