=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/buf.c,v retrieving revision 1.43 retrieving revision 1.44 diff -c -r1.43 -r1.44 *** src/usr.bin/cvs/buf.c 2006/04/06 16:48:34 1.43 --- src/usr.bin/cvs/buf.c 2006/04/10 19:03:10 1.44 *************** *** 1,4 **** ! /* $OpenBSD: buf.c,v 1.43 2006/04/06 16:48:34 xsa Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: buf.c,v 1.44 2006/04/10 19:03:10 niallo Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau * All rights reserved. *************** *** 351,361 **** (void)unlink(path); fatal("cvs_buf_write: cvs_buf_write_fd: `%s'", path); } - (void)close(fd); ! if (chmod(path, mode) < 0) ! fatal("cvs_buf_write: chmod failed: %s", strerror(errno)); return (0); } --- 351,362 ---- (void)unlink(path); fatal("cvs_buf_write: cvs_buf_write_fd: `%s'", path); } ! if (fchmod(fd, mode) < 0) ! cvs_log(LP_ERRNO, "permissions not set on file %s", path); + (void)close(fd); + return (0); } *************** *** 378,384 **** (void)unlink(template); fatal("cvs_buf_write_stmp: cvs_buf_write_fd: `%s'", template); } ! (void)fchmod(fd, mode); (void)close(fd); } --- 379,388 ---- (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); ! (void)close(fd); }