summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/import.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:35:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:35:06 +0000
commit61656abc7ff84215165af1bd464bc053b3b66158 (patch)
treec7eabb0c4fa9faa024e724e99c240c40da07ca42 /usr.bin/cvs/import.c
parent18603ebf99fbb890ae9666cb0c4aa9f879e7edaa (diff)
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/import.c')
-rw-r--r--usr.bin/cvs/import.c4
1 files changed, 2 insertions, 2 deletions
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 <joris@openbsd.org>
*
@@ -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,