version 1.196, 2007/09/09 20:24:06 |
version 1.197, 2007/09/17 10:07:21 |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
#include "atomicio.h" |
#include "cvs.h" |
#include "cvs.h" |
|
|
#define CVS_IGN_STATIC 0x01 /* pattern is static, no need to glob */ |
#define CVS_IGN_STATIC 0x01 /* pattern is static, no need to glob */ |
|
|
mtime = st.st_mtimespec.tv_sec; |
mtime = st.st_mtimespec.tv_sec; |
|
|
if (S_ISREG(st.st_mode)) { |
if (S_ISREG(st.st_mode)) { |
size_t sz; |
char *p; |
ssize_t nw; |
|
char *p, *buf; |
|
int saved_errno; |
int saved_errno; |
|
|
if (st.st_size > (off_t)SIZE_MAX) { |
if (st.st_size > (off_t)SIZE_MAX) { |
|
|
|
|
madvise(p, st.st_size, MADV_SEQUENTIAL); |
madvise(p, st.st_size, MADV_SEQUENTIAL); |
|
|
sz = st.st_size; |
if (atomicio(vwrite, dst, p, st.st_size) != st.st_size) { |
buf = p; |
saved_errno = errno; |
|
(void)unlink(to); |
while (sz > 0) { |
fatal("cvs_file_copy: `%s': %s", from, |
if ((nw = write(dst, p, sz)) == -1) { |
strerror(saved_errno)); |
saved_errno = errno; |
|
(void)unlink(to); |
|
fatal("cvs_file_copy: `%s': %s", |
|
from, strerror(saved_errno)); |
|
} |
|
buf += nw; |
|
sz -= nw; |
|
} |
} |
|
|
(void)munmap(p, st.st_size); |
(void)munmap(p, st.st_size); |