summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2006-04-01 18:02:56 +0000
committerJoris Vink <joris@cvs.openbsd.org>2006-04-01 18:02:56 +0000
commitf92e8b844490c2117a8a2549bb4e957337b7dd03 (patch)
tree845c7394197a9a29ffa76297096259357e7ebd05
parentc1a4b4a0335e9ed3e587abff67f19ff34d478e47 (diff)
don't use mode_t with va_arg(), use int instead and cast it later to
mode_t. doing it the other way around isn't portable as mode_t may vary from int on some systems to short on others. noticed by deraadt@
-rw-r--r--usr.bin/cvs/rcs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index c89fc1a076b..51b6e3c3d3a 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.158 2006/03/30 23:12:52 joris Exp $ */
+/* $OpenBSD: rcs.c,v 1.159 2006/04/01 18:02:55 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -271,7 +271,7 @@ static char* rcs_expand_keywords(char *, struct rcs_delta *, char *,
RCSFILE *
rcs_open(const char *path, int flags, ...)
{
- int ret;
+ int ret, mode;
mode_t fmode;
RCSFILE *rfp;
struct stat st;
@@ -285,8 +285,9 @@ rcs_open(const char *path, int flags, ...)
if (((ret = stat(path, &st)) == -1) && (errno == ENOENT)) {
if (flags & RCS_CREATE) {
va_start(vap, flags);
- fmode = va_arg(vap, mode_t);
+ mode = va_arg(vap, int);
va_end(vap);
+ fmode = (mode_t)mode;
} else {
/* XXX, make this command dependant? */
#if 0