summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2007-06-12 06:09:39 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2007-06-12 06:09:39 +0000
commitde6b92ce5ff6ca234e79eb384d7c62f17a8d75df (patch)
treef5b1a3496623d3d41f7cf632b59dcc70a65d36da /usr.bin/rcs
parent5ede0d7eab32fc9ebe8f44e39e48767673144fc9 (diff)
Allow checkin without locking (after rcs -U). Matches GNU's behaviour.
Problem reported by itojun@. Tests itojun@; OK niallo@.
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/ci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index 2e3c98c68bc..1e9d44bf64a 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.198 2007/04/26 21:48:37 sobrado Exp $ */
+/* $OpenBSD: ci.c,v 1.199 2007/06/12 06:09:38 xsa Exp $ */
/*
* Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -531,7 +531,8 @@ checkin_update(struct checkin_params *pb)
pb->flags);
}
- if (rcs_lock_remove(pb->file, pb->username, pb->frev) < 0) {
+ if ((rcs_lock_remove(pb->file, pb->username, pb->frev) < 0) &&
+ (rcs_lock_getmode(pb->file) != RCS_LOCK_LOOSE)) {
if (rcs_errno != RCS_ERR_NOENT)
warnx("failed to remove lock");
else if (!(pb->flags & CO_LOCK))
@@ -800,6 +801,9 @@ checkin_checklock(struct checkin_params *pb)
{
struct rcs_lock *lkp;
+ if (rcs_lock_getmode(pb->file) == RCS_LOCK_LOOSE)
+ return (0);
+
TAILQ_FOREACH(lkp, &(pb->file->rf_locks), rl_list) {
if (!strcmp(lkp->rl_name, pb->username) &&
!rcsnum_cmp(lkp->rl_num, pb->frev, 0))