copy-file: add error-code-returning variant.
authorReuben Thomas <rrt@sc3d.org>
Thu, 12 Jan 2012 02:04:49 +0000 (03:04 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 12 Jan 2012 02:04:49 +0000 (03:04 +0100)
commit24a2f3c6ac107e6b35f1ac9f273b691738ef3f9a
tree3bf98a715d004876e9e2aaa06c1659c377046e5b
parentdd5c6076e60de0237ab75d5a3a77070231d6c0fd
copy-file: add error-code-returning variant.

* lib/copy-file.h (GL_COPY_ERR_*): New enumeration items.
(qcopy_file_preserving): New declaration.
* lib/copy-file.c (qcopy_file_preserving): Renamed from
copy_file_preserving. Change return type to 'int'. Don't emit an error
message here.
(copy_file_preserving): New function.
* tests/test-copy-file.c: Include <stdlib.h>.
(main): Test qcopy_file_preserving if the environment variable
NO_STDERR_OUTPUT is set.
* tests/test-copy-file-1.sh: Invoke test-copy-file.sh a second time,
with NO_STDERR_OUTPUT
* tests/test-copy-file-2.sh: Likewise.
ChangeLog
lib/copy-file.c
lib/copy-file.h
tests/test-copy-file-1.sh
tests/test-copy-file-2.sh
tests/test-copy-file.c