From 3aaa63eb46949490a39db9c6d82aacc8ee5d8551 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 28 Jun 2019 13:34:58 +0000 Subject: 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. --- usr.bin/cvs/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/cvs/commit.c') diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index c1523e442f3..61d5dd26217 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.159 2018/12/30 23:09:58 guenther Exp $ */ +/* $OpenBSD: commit.c,v 1.160 2019/06/28 13:35:00 deraadt Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2006 Xavier Santolaria @@ -537,7 +537,7 @@ cvs_commit_local(struct cvs_file *cf) } cf->repo_fd = open(cf->file_rpath, openflags); - if (cf->repo_fd < 0) + if (cf->repo_fd == -1) fatal("cvs_commit_local: %s", strerror(errno)); cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, -- cgit v1.2.3-59-g8ed1b