version 1.44, 2006/04/10 19:03:10 |
version 1.45, 2006/04/10 19:49:44 |
|
|
#include "buf.h" |
#include "buf.h" |
#include "log.h" |
#include "log.h" |
#include "xmalloc.h" |
#include "xmalloc.h" |
|
#include "worklist.h" |
|
|
#define BUF_INCR 128 |
#define BUF_INCR 128 |
|
|
|
|
if ((fd = mkstemp(template)) == -1) |
if ((fd = mkstemp(template)) == -1) |
fatal("mkstemp: `%s': %s", template, strerror(errno)); |
fatal("mkstemp: `%s': %s", template, strerror(errno)); |
|
|
|
#if defined(RCSPROG) |
|
cvs_worklist_add(template, &rcs_temp_files); |
|
#endif |
|
|
if (cvs_buf_write_fd(b, fd) == -1) { |
if (cvs_buf_write_fd(b, fd) == -1) { |
(void)unlink(template); |
(void)unlink(template); |
fatal("cvs_buf_write_stmp: cvs_buf_write_fd: `%s'", template); |
fatal("cvs_buf_write_stmp: cvs_buf_write_fd: `%s'", template); |
} |
} |
|
|
if (fchmod(fd, mode) < 0) |
if (fchmod(fd, mode) < 0) |
cvs_log(LP_ERRNO, "permissions not set on temporary file %s", |
cvs_log(LP_ERRNO, "permissions not set on temporary file %s", |
template); |
template); |