const void *key, struct group *grp, uid_t owner,
struct hashentry *const he, struct datahead *dh, int errval)
{
- bool all_written = true;
ssize_t total;
ssize_t written;
time_t t = time (NULL);
# endif
#endif
written = writeall (fd, &dataset->resp, dataset->head.recsize);
-
- if (written != dataset->head.recsize)
- all_written = false;
}
/* Add the record to the database. But only if it has not been
}
}
- if (__builtin_expect (!all_written, 0) && debug_level > 0)
+ if (__builtin_expect (written != total, 0) && debug_level > 0)
{
char buf[256];
dbg_log (_("short write in %s: %s"), __FUNCTION__,
nip = nip->next;
}
- bool all_written;
ssize_t total;
ssize_t written;
time_t timeout;
out:
- all_written = true;
timeout = MAX_TIMEOUT_VALUE;
if (!any_success)
{
# endif
#endif
written = writeall (fd, &dataset->resp, dataset->head.recsize);
-
- if (written != dataset->head.recsize)
- all_written = false;
}
free (groups);
- if (__builtin_expect (!all_written, 0) && debug_level > 0)
+ if (__builtin_expect (written != total, 0) && debug_level > 0)
{
char buf[256];
dbg_log (_("short write in %s: %s"), __FUNCTION__,
const void *key, struct passwd *pwd, uid_t owner,
struct hashentry *const he, struct datahead *dh, int errval)
{
- bool all_written = true;
ssize_t total;
ssize_t written;
time_t t = time (NULL);
+ db->head->data_size));
written = sendfileall (fd, db->wr_fd,
(char *) &dataset->resp
- - (char *) db->head, dataset->head.recsize);
+ - (char *) db->head, dataset->head.recsize );
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;
# endif
#endif
written = writeall (fd, &dataset->resp, dataset->head.recsize);
-
- if (written != dataset->head.recsize)
- all_written = false;
}
}
}
- if (__builtin_expect (!all_written, 0) && debug_level > 0)
+ if (__builtin_expect (written != total, 0) && debug_level > 0)
{
char buf[256];
dbg_log (_("short write in %s: %s"), __FUNCTION__,
const void *key, struct servent *serv, uid_t owner,
struct hashentry *const he, struct datahead *dh, int errval)
{
- bool all_written = true;
ssize_t total;
ssize_t written;
time_t t = time (NULL);
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
- assert ((char *) dataset - (char *) db->head
+ assert ((char *) &dataset->resp - (char *) db->head
+ total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
written = sendfileall (fd, db->wr_fd,
(char *) &dataset->resp
- - (char *) db->head, dataset->head.recsize);
+ - (char *) db->head, total);
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;
use_write:
# endif
#endif
- written = writeall (fd, &dataset->resp, dataset->head.recsize);
-
- if (written != dataset->head.recsize)
- all_written = false;
+ written = writeall (fd, &dataset->resp, total);
}
/* Add the record to the database. But only if it has not been
}
}
- if (__builtin_expect (!all_written, 0) && debug_level > 0)
+ if (__builtin_expect (written != total, 0) && debug_level > 0)
{
char buf[256];
dbg_log (_("short write in %s: %s"), __FUNCTION__,