diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-12 18:34:38 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-12 18:34:38 +0000 |
commit | daada83aa1b73838d52c7cd3bbbe89fd604d4191 (patch) | |
tree | f2a20125e1ef6cc456a37588fb754fda4f983107 | |
parent | d454172bb99955f68cb2b413b6469de00d062ba4 (diff) |
Before stating the Root file, make sure we actually have something to
write in it
-rw-r--r-- | usr.bin/cvs/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index 7c96ad39f0d..bf77b38beb1 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.7 2004/08/06 20:08:49 jfb Exp $ */ +/* $OpenBSD: util.c,v 1.8 2004/08/12 18:34:37 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -401,7 +401,7 @@ cvs_mkadmin(struct cvs_file *cdir, mode_t mode) root = cdir->cf_ddat->cd_root; snprintf(path, sizeof(path), "%s/" CVS_PATH_ROOTSPEC, cdir->cf_path); - if ((stat(path, &st) != 0) && (errno == ENOENT) && (root != NULL)) { + if ((root != NULL) && (stat(path, &st) != 0) && (errno == ENOENT)) { fp = fopen(path, "w"); if (fp == NULL) { cvs_log(LP_ERRNO, "failed to open %s", path); |