- Updated the address for the FSF in the opening comment.
[rsync/rsync.git] / fileio.c
index 1806209..138301c 100644 (file)
--- a/fileio.c
+++ b/fileio.c
@@ -1,25 +1,25 @@
 /*
-   Copyright (C) Andrew Tridgell 1998
-   Copyright (C) 2002 by Martin Pool
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   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 General Public License for more details.
-
-   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., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
+ * File IO utilities used in rsync.
+ *
+ * Copyright (C) 1998 Andrew Tridgell
+ * Copyright (C) 2002 Martin Pool
+ * Copyright (C) 2004, 2005, 2006 Wayne Davison
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 General Public License for more details.
+ *
+ * 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
+ */
 
-/*
-  File IO utilities used in rsync
-  */
 #include "rsync.h"
 
 #ifndef ENODATA
@@ -232,7 +232,6 @@ char *map_ptr(struct map_struct *map, OFF_T offset, int32 len)
                }
                map->p_fd_offset = read_start;
        }
-       map->p_fd_offset += read_size;
        map->p_offset = window_start;
        map->p_len = window_size;
 
@@ -246,6 +245,7 @@ char *map_ptr(struct map_struct *map, OFF_T offset, int32 len)
                        memset(map->p + read_offset, 0, read_size);
                        break;
                }
+               map->p_fd_offset += nread;
                read_offset += nread;
                read_size -= nread;
        }