diff options
Diffstat (limited to 'nscd/grpcache.c')
-rw-r--r-- | nscd/grpcache.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/nscd/grpcache.c b/nscd/grpcache.c index fb043152c6..d38a92809e 100644 --- a/nscd/grpcache.c +++ b/nscd/grpcache.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 <string.h> #include <unistd.h> #include <sys/mman.h> -#ifdef HAVE_SENDFILE -# include <sys/sendfile.h> -#endif #include <sys/socket.h> #include <stackinfo.h> @@ -310,8 +305,9 @@ cache_addgr (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; |