From 61656abc7ff84215165af1bd464bc053b3b66158 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 28 Jun 2019 13:35:06 +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/import.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/cvs/import.c') diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c index 4c2d239740b..de66cb5af3b 100644 --- a/usr.bin/cvs/import.c +++ b/usr.bin/cvs/import.c @@ -1,4 +1,4 @@ -/* $OpenBSD: import.c,v 1.108 2017/06/01 08:08:24 joris Exp $ */ +/* $OpenBSD: import.c,v 1.109 2019/06/28 13:35:00 deraadt Exp $ */ /* * Copyright (c) 2006 Joris Vink * @@ -338,7 +338,7 @@ import_new(struct cvs_file *cf) fatal("import_new: failed to get first branch revision"); cf->repo_fd = open(cf->file_rpath, O_CREAT | O_RDONLY); - if (cf->repo_fd < 0) + if (cf->repo_fd == -1) fatal("import_new: %s: %s", cf->file_rpath, strerror(errno)); cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, RCS_CREATE, -- cgit v1.2.3