diff options
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/buf.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/worklist.h | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c index 096feb2c670..e6734ddc567 100644 --- a/usr.bin/cvs/buf.c +++ b/usr.bin/cvs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.44 2006/04/10 19:03:10 niallo Exp $ */ +/* $OpenBSD: buf.c,v 1.45 2006/04/10 19:49:44 joris Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -29,6 +29,7 @@ #include "buf.h" #include "log.h" #include "xmalloc.h" +#include "worklist.h" #define BUF_INCR 128 @@ -375,10 +376,15 @@ cvs_buf_write_stmp(BUF *b, char *template, mode_t mode) if ((fd = mkstemp(template)) == -1) 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) { (void)unlink(template); fatal("cvs_buf_write_stmp: cvs_buf_write_fd: `%s'", template); } + if (fchmod(fd, mode) < 0) cvs_log(LP_ERRNO, "permissions not set on temporary file %s", template); diff --git a/usr.bin/cvs/worklist.h b/usr.bin/cvs/worklist.h index e73a14f59c4..8e0dee01674 100644 --- a/usr.bin/cvs/worklist.h +++ b/usr.bin/cvs/worklist.h @@ -1,4 +1,4 @@ -/* $OpenBSD: worklist.h,v 1.3 2006/03/15 18:24:43 deraadt Exp $ */ +/* $OpenBSD: worklist.h,v 1.4 2006/04/10 19:49:44 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -40,4 +40,8 @@ void cvs_worklist_clean(struct cvs_wklhead *, void (*cb)(struct cvs_worklist *)) void cvs_worklist_unlink(struct cvs_worklist *); +#if defined(RCSPROG) +extern struct cvs_wklhead rcs_temp_files; +#endif + #endif |