diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-05-08 18:36:05 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-05-08 18:36:05 +0000 |
commit | a636a8214bff0e483b729cbe5903471d63b85759 (patch) | |
tree | 2e6cfcb846996b41a3ecb7aa214aa8a6193438b0 /usr.bin/rcs | |
parent | 806c5e4c051c2a840d87bd9ba50f223ecb2851ad (diff) |
properly handle exit code 1; OK ray@.
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r-- | usr.bin/rcs/diff.h | 7 | ||||
-rw-r--r-- | usr.bin/rcs/rcsmerge.c | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/usr.bin/rcs/diff.h b/usr.bin/rcs/diff.h index fdf7cfa821e..f41171f1f41 100644 --- a/usr.bin/rcs/diff.h +++ b/usr.bin/rcs/diff.h @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.h,v 1.2 2006/05/05 15:47:36 xsa Exp $ */ +/* $OpenBSD: diff.h,v 1.3 2006/05/08 18:36:04 xsa Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -87,6 +87,11 @@ #define D_DIFFER 1 /* Files are different */ #define D_ERROR 2 /* An error occurred */ +/* + * Status values for rcs_diff3() return values + */ +#define D_OVERLAPS 1 /* Overlaps during merge */ + struct rcs_lines; BUF *rcs_diff3(RCSFILE *, char *, RCSNUM *, RCSNUM *, int); diff --git a/usr.bin/rcs/rcsmerge.c b/usr.bin/rcs/rcsmerge.c index fd114ed5029..24499f1db96 100644 --- a/usr.bin/rcs/rcsmerge.c +++ b/usr.bin/rcs/rcsmerge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsmerge.c,v 1.40 2006/05/08 11:56:16 xsa Exp $ */ +/* $OpenBSD: rcsmerge.c,v 1.41 2006/05/08 18:36:04 xsa Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -32,7 +32,7 @@ int rcsmerge_main(int argc, char **argv) { - int fd, i, ch, flags, kflag; + int fd, i, ch, flags, kflag, status; char *fcont, fpath[MAXPATHLEN], r1[16], r2[16], *rev_str1, *rev_str2; RCSFILE *file; RCSNUM *rev1, *rev2; @@ -40,6 +40,7 @@ rcsmerge_main(int argc, char **argv) flags = 0; kflag = RCS_KWEXP_ERR; + status = 0; rev1 = rev2 = NULL; rev_str1 = rev_str2 = NULL; @@ -159,6 +160,9 @@ rcsmerge_main(int argc, char **argv) continue; } + if (diff3_conflicts != 0) + status = D_OVERLAPS; + if (flags & PIPEOUT) { rcs_buf_putc(bp, '\0'); fcont = rcs_buf_release(bp); @@ -174,7 +178,7 @@ rcsmerge_main(int argc, char **argv) rcs_close(file); } - return (0); + return (status); } void |