summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/diff3.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-28 13:34:58 +0000
committerderaadt <deraadt@openbsd.org>2019-06-28 13:34:58 +0000
commit3aaa63eb46949490a39db9c6d82aacc8ee5d8551 (patch)
treeef48ea58ad350ab9d01fbfe32455a1df1fa2340c /usr.bin/cvs/diff3.c
parentfputc/fputs return EOF on error (diff)
downloadwireguard-openbsd-3aaa63eb46949490a39db9c6d82aacc8ee5d8551.tar.xz
wireguard-openbsd-3aaa63eb46949490a39db9c6d82aacc8ee5d8551.zip
When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r--usr.bin/cvs/diff3.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index d076e47c139..e8e0512d85a 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.62 2016/10/18 21:06:52 millert Exp $ */
+/* $OpenBSD: diff3.c,v 1.63 2019/06/28 13:35:00 deraadt Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -207,11 +207,11 @@ cvs_merge_file(struct cvs_file *cf, int verbose)
argv[argc++] = path2;
argv[argc++] = path3;
- if (lseek(fds[2], 0, SEEK_SET) < 0)
+ if (lseek(fds[2], 0, SEEK_SET) == -1)
fatal("cvs_merge_file: lseek fds[2]: %s", strerror(errno));
- if (lseek(fds[3], 0, SEEK_SET) < 0)
+ if (lseek(fds[3], 0, SEEK_SET) == -1)
fatal("cvs_merge_file: lseek fds[3]: %s", strerror(errno));
- if (lseek(fds[4], 0, SEEK_SET) < 0)
+ if (lseek(fds[4], 0, SEEK_SET) == -1)
fatal("cvs_merge_file: lseek fds[4]: %s", strerror(errno));
diff3_conflicts = diff3_internal(argc, argv, cf->file_path, r2);