#include <errno.h>
#include <fcntl.h>
+#include <stddef.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
int mode;
int dest_fd;
char buf[4096];
- const int buf_size = sizeof (buf);
+ const size_t buf_size = sizeof (buf);
src_fd = open (src_filename, O_RDONLY | O_BINARY);
if (src_fd < 0 || fstat (src_fd, &statbuf) < 0)
}
#endif
+#if HAVE_CHOWN
/* Preserve the owner and group. */
chown (dest_filename, statbuf.st_uid, statbuf.st_gid);
+#endif
/* Preserve the access permissions. */
chmod (dest_filename, mode);