Mercurial > gnulib
annotate lib/copy-file.c @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | 8c32877a40e6 |
children | 344018b6e5d7 |
rev | line source |
---|---|
4266 | 1 /* Copying of files. |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16273
diff
changeset
|
2 Copyright (C) 2001-2003, 2006-2007, 2009-2013 Free Software Foundation, Inc. |
4266 | 3 Written by Bruno Haible <haible@clisp.cons.org>, 2001. |
4 | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8196
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
4266 | 6 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8196
diff
changeset
|
7 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8196
diff
changeset
|
8 (at your option) any later version. |
4266 | 9 |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8196
diff
changeset
|
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
4266 | 17 |
18 | |
7304
1c4ed7637c24
Include <config.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents:
6751
diff
changeset
|
19 #include <config.h> |
4266 | 20 |
21 /* Specification. */ | |
22 #include "copy-file.h" | |
23 | |
24 #include <errno.h> | |
25 #include <fcntl.h> | |
4310
17ce7ef2789c
Include <stddef.h>, for size_t.
Bruno Haible <bruno@clisp.org>
parents:
4308
diff
changeset
|
26 #include <stddef.h> |
8196
5166dec344af
exit.h is replaced with stdlib.h.
Bruno Haible <bruno@clisp.org>
parents:
7863
diff
changeset
|
27 #include <stdlib.h> |
4266 | 28 #include <sys/stat.h> |
6751
1b0092424a44
Include <unistd.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents:
6259
diff
changeset
|
29 #include <unistd.h> |
4266 | 30 |
31 #if HAVE_UTIME || HAVE_UTIMES | |
32 # if HAVE_UTIME_H | |
33 # include <utime.h> | |
34 # else | |
35 # include <sys/utime.h> | |
36 # endif | |
37 #endif | |
38 | |
39 #include "error.h" | |
17361
8c32877a40e6
copy-file, rpmatch: fix problems found by cppcheck
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
40 #include "ignore-value.h" |
4266 | 41 #include "safe-read.h" |
42 #include "full-write.h" | |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
43 #include "acl.h" |
4266 | 44 #include "binary-io.h" |
16271 | 45 #include "quote.h" |
4266 | 46 #include "gettext.h" |
12198
e8fbc5424b99
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
9309
diff
changeset
|
47 #include "xalloc.h" |
4266 | 48 |
49 #define _(str) gettext (str) | |
50 | |
7863 | 51 /* The results of open() in this file are not used with fchdir, |
52 therefore save some unnecessary work in fchdir.c. */ | |
53 #undef open | |
54 #undef close | |
55 | |
12198
e8fbc5424b99
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
9309
diff
changeset
|
56 enum { IO_SIZE = 32 * 1024 }; |
7863 | 57 |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
58 int |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
59 qcopy_file_preserving (const char *src_filename, const char *dest_filename) |
4266 | 60 { |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
61 int err = 0; |
4266 | 62 int src_fd; |
63 struct stat statbuf; | |
64 int mode; | |
65 int dest_fd; | |
12198
e8fbc5424b99
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
9309
diff
changeset
|
66 char *buf = xmalloc (IO_SIZE); |
4266 | 67 |
68 src_fd = open (src_filename, O_RDONLY | O_BINARY); | |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
69 if (src_fd < 0) |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
70 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
71 err = GL_COPY_ERR_OPEN_READ; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
72 goto error; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
73 } |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
74 if (fstat (src_fd, &statbuf) < 0) |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
75 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
76 err = GL_COPY_ERR_OPEN_READ; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
77 goto error_src; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
78 } |
4266 | 79 |
80 mode = statbuf.st_mode & 07777; | |
81 | |
82 dest_fd = open (dest_filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0600); | |
83 if (dest_fd < 0) | |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
84 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
85 err = GL_COPY_ERR_OPEN_BACKUP_WRITE; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
86 goto error_src; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
87 } |
4266 | 88 |
89 /* Copy the file contents. */ | |
90 for (;;) | |
91 { | |
12198
e8fbc5424b99
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
9309
diff
changeset
|
92 size_t n_read = safe_read (src_fd, buf, IO_SIZE); |
4266 | 93 if (n_read == SAFE_READ_ERROR) |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
94 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
95 err = GL_COPY_ERR_READ; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
96 goto error_src_dest; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
97 } |
4266 | 98 if (n_read == 0) |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12198
diff
changeset
|
99 break; |
4266 | 100 |
101 if (full_write (dest_fd, buf, n_read) < n_read) | |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
102 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
103 err = GL_COPY_ERR_WRITE; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
104 goto error_src_dest; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
105 } |
4266 | 106 } |
107 | |
12198
e8fbc5424b99
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
9309
diff
changeset
|
108 free (buf); |
e8fbc5424b99
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
9309
diff
changeset
|
109 |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
110 #if !USE_ACL |
4266 | 111 if (close (dest_fd) < 0) |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
112 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
113 err = GL_COPY_ERR_WRITE; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
114 goto error_src; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
115 } |
4266 | 116 if (close (src_fd) < 0) |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
117 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
118 err = GL_COPY_ERR_AFTER_READ; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
119 goto error; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
120 } |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
121 #endif |
4266 | 122 |
123 /* Preserve the access and modification times. */ | |
124 #if HAVE_UTIME | |
125 { | |
126 struct utimbuf ut; | |
127 | |
128 ut.actime = statbuf.st_atime; | |
129 ut.modtime = statbuf.st_mtime; | |
130 utime (dest_filename, &ut); | |
131 } | |
132 #elif HAVE_UTIMES | |
133 { | |
134 struct timeval ut[2]; | |
135 | |
136 ut[0].tv_sec = statbuf.st_atime; ut[0].tv_usec = 0; | |
137 ut[1].tv_sec = statbuf.st_mtime; ut[1].tv_usec = 0; | |
138 utimes (dest_filename, &ut); | |
139 } | |
140 #endif | |
141 | |
4268 | 142 #if HAVE_CHOWN |
4266 | 143 /* Preserve the owner and group. */ |
17361
8c32877a40e6
copy-file, rpmatch: fix problems found by cppcheck
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
144 ignore_value (chown (dest_filename, statbuf.st_uid, statbuf.st_gid)); |
4268 | 145 #endif |
4266 | 146 |
147 /* Preserve the access permissions. */ | |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
148 #if USE_ACL |
16271 | 149 switch (qcopy_acl (src_filename, src_fd, dest_filename, dest_fd, mode)) |
150 { | |
151 case -2: | |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
152 err = GL_COPY_ERR_GET_ACL; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
153 goto error_src_dest; |
16271 | 154 case -1: |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
155 err = GL_COPY_ERR_SET_ACL; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
156 goto error_src_dest; |
16271 | 157 } |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
158 #else |
4266 | 159 chmod (dest_filename, mode); |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
160 #endif |
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
161 |
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
162 #if USE_ACL |
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
163 if (close (dest_fd) < 0) |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
164 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
165 err = GL_COPY_ERR_WRITE; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
166 goto error_src; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
167 } |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
168 if (close (src_fd) < 0) |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
169 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
170 err = GL_COPY_ERR_AFTER_READ; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
171 goto error; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
172 } |
7742
4a26effdff28
Preserve ACLs while copying.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
173 #endif |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
174 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
175 return 0; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
176 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
177 error_src_dest: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
178 close (dest_fd); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
179 error_src: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
180 close (src_fd); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
181 error: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
182 return err; |
4266 | 183 } |
16273
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
184 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
185 void |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
186 copy_file_preserving (const char *src_filename, const char *dest_filename) |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
187 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
188 switch (qcopy_file_preserving (src_filename, dest_filename)) |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
189 { |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
190 case 0: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
191 return; |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
192 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
193 case GL_COPY_ERR_OPEN_READ: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
194 error (EXIT_FAILURE, errno, _("error while opening %s for reading"), |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
195 quote (src_filename)); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
196 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
197 case GL_COPY_ERR_OPEN_BACKUP_WRITE: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
198 error (EXIT_FAILURE, errno, _("cannot open backup file %s for writing"), |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
199 quote (dest_filename)); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
200 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
201 case GL_COPY_ERR_READ: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
202 error (EXIT_FAILURE, errno, _("error reading %s"), |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
203 quote (src_filename)); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
204 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
205 case GL_COPY_ERR_WRITE: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
206 error (EXIT_FAILURE, errno, _("error writing %s"), |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
207 quote (dest_filename)); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
208 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
209 case GL_COPY_ERR_AFTER_READ: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
210 error (EXIT_FAILURE, errno, _("error after reading %s"), |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
211 quote (src_filename)); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
212 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
213 case GL_COPY_ERR_GET_ACL: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
214 error (EXIT_FAILURE, errno, "%s", quote (src_filename)); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
215 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
216 case GL_COPY_ERR_SET_ACL: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
217 error (EXIT_FAILURE, errno, _("preserving permissions for %s"), |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
218 quote (dest_filename)); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
219 |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
220 default: |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
221 abort (); |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
222 } |
d50152d6b5d2
copy-file: add error-code-returning variant.
Reuben Thomas <rrt@sc3d.org>
parents:
16272
diff
changeset
|
223 } |