diff options
-rw-r--r-- | usr.bin/cvs/remove.c | 14 | ||||
-rw-r--r-- | usr.bin/cvs/resp.c | 6 |
2 files changed, 7 insertions, 13 deletions
diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c index 7eb5198f7e7..3e72ca6062b 100644 --- a/usr.bin/cvs/remove.c +++ b/usr.bin/cvs/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.23 2005/07/24 16:46:40 xsa Exp $ */ +/* $OpenBSD: remove.c,v 1.24 2005/07/24 17:20:14 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2004, 2005 Xavier Santolaria <xsa@openbsd.org> @@ -177,11 +177,9 @@ cvs_remove_local(CVSFILE *cf, void *arg) cvs_log(LP_ERRNO, "%s", buf); return (CVS_EX_DATA); } - if ((cvs_noexec == 0) && - (unlink(buf) == -1) && (errno != ENOENT)) { - cvs_log(LP_ERRNO, "cannot remove %s", buf); + if ((cvs_unlink(buf) == -1) && (errno != ENOENT)) return (CVS_EX_FILE); - } + if (verbosity > 1) cvs_log(LP_INFO, "removed `%s'", cf->cf_name); return (0); @@ -227,11 +225,9 @@ static int cvs_remove_file(const char *fpath) { /* if -f option is used, physically remove the file */ - if ((force_remove == 1) && (cvs_noexec == 0)) { - if((unlink(fpath) == -1) && (errno != ENOENT)) { - cvs_log(LP_ERRNO, "unable to remove %s", fpath); + if (force_remove == 1) { + if((cvs_unlink(fpath) == -1) && (errno != ENOENT)) return (-1); - } nuked++; } diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index afd6cc3f505..28ddf11ecc4 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.48 2005/07/24 16:46:40 xsa Exp $ */ +/* $OpenBSD: resp.c,v 1.49 2005/07/24 17:20:14 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -368,9 +368,7 @@ cvs_resp_statdir(struct cvsroot *root, int type, char *line) if (cvs_noexec == 0) { if ((type == CVS_RESP_CLRSTATDIR) && - (unlink(statpath) == -1) && (errno != ENOENT)) { - cvs_log(LP_ERRNO, "failed to unlink %s file", - CVS_PATH_STATICENTRIES); + (cvs_unlink(statpath) == -1) && (errno != ENOENT)) { return (-1); } else if (type == CVS_RESP_SETSTATDIR) { fd = open(statpath, O_CREAT|O_TRUNC|O_WRONLY, 0644); |