summaryrefslogtreecommitdiff
path: root/nscd/pwdcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/pwdcache.c')
-rw-r--r--nscd/pwdcache.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c
index 6f4b032d10..529c707de8 100644
--- a/nscd/pwdcache.c
+++ b/nscd/pwdcache.c
@@ -3,20 +3,18 @@
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2 as
+ published by the Free Software Foundation.
- The GNU C Library is distributed in the hope that it will be useful,
+ This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <alloca.h>
#include <assert.h>
@@ -32,9 +30,6 @@
#include <time.h>
#include <unistd.h>
#include <sys/mman.h>
-#ifdef HAVE_SENDFILE
-# include <sys/sendfile.h>
-#endif
#include <sys/socket.h>
#include <stackinfo.h>
@@ -305,8 +300,9 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
- off_t off = (char *) &dataset->resp - (char *) db->head;
- written = sendfile (fd, db->wr_fd, &off, total);
+ written = sendfileall (fd, db->wr_fd,
+ (char *) &dataset->resp
+ - (char *) db->head, total);
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;