| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $ */ | | 1 | /* $NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1991, 1993, 1994 | | 4 | * Copyright (c) 1991, 1993, 1994 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -24,27 +24,27 @@ | | | @@ -24,27 +24,27 @@ |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | #ifndef lint | | 33 | #ifndef lint |
34 | #if 0 | | 34 | #if 0 |
35 | static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; | | 35 | static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; |
36 | #else | | 36 | #else |
37 | __RCSID("$NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $"); | | 37 | __RCSID("$NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $"); |
38 | #endif | | 38 | #endif |
39 | #endif /* not lint */ | | 39 | #endif /* not lint */ |
40 | | | 40 | |
41 | #include <sys/mman.h> | | 41 | #include <sys/mman.h> |
42 | #include <sys/param.h> | | 42 | #include <sys/param.h> |
43 | #include <sys/stat.h> | | 43 | #include <sys/stat.h> |
44 | #include <sys/time.h> | | 44 | #include <sys/time.h> |
45 | #include <sys/extattr.h> | | 45 | #include <sys/extattr.h> |
46 | | | 46 | |
47 | #include <err.h> | | 47 | #include <err.h> |
48 | #include <errno.h> | | 48 | #include <errno.h> |
49 | #include <fcntl.h> | | 49 | #include <fcntl.h> |
50 | #include <fts.h> | | 50 | #include <fts.h> |
| @@ -58,27 +58,27 @@ __RCSID("$NetBSD: utils.c,v 1.43 2015/03 | | | @@ -58,27 +58,27 @@ __RCSID("$NetBSD: utils.c,v 1.43 2015/03 |
58 | | | 58 | |
59 | #define MMAP_MAX_SIZE (8 * 1048576) | | 59 | #define MMAP_MAX_SIZE (8 * 1048576) |
60 | #define MMAP_MAX_WRITE (64 * 1024) | | 60 | #define MMAP_MAX_WRITE (64 * 1024) |
61 | | | 61 | |
62 | int | | 62 | int |
63 | set_utimes(const char *file, struct stat *fs) | | 63 | set_utimes(const char *file, struct stat *fs) |
64 | { | | 64 | { |
65 | struct timespec ts[2]; | | 65 | struct timespec ts[2]; |
66 | | | 66 | |
67 | ts[0] = fs->st_atimespec; | | 67 | ts[0] = fs->st_atimespec; |
68 | ts[1] = fs->st_mtimespec; | | 68 | ts[1] = fs->st_mtimespec; |
69 | | | 69 | |
70 | if (lutimens(file, ts)) { | | 70 | if (lutimens(file, ts)) { |
71 | warn("lutimes: %s", file); | | 71 | warn("lutimens: %s", file); |
72 | return (1); | | 72 | return (1); |
73 | } | | 73 | } |
74 | return (0); | | 74 | return (0); |
75 | } | | 75 | } |
76 | | | 76 | |
77 | struct finfo { | | 77 | struct finfo { |
78 | const char *from; | | 78 | const char *from; |
79 | const char *to; | | 79 | const char *to; |
80 | size_t size; | | 80 | size_t size; |
81 | }; | | 81 | }; |
82 | | | 82 | |
83 | static void | | 83 | static void |
84 | progress(const struct finfo *fi, size_t written) | | 84 | progress(const struct finfo *fi, size_t written) |