Module Name:    src
Committed By:   dholland
Date:           Mon Aug 31 05:34:16 UTC 2009

Modified Files:
        src/sys/compat/irix: irix_fcntl.c

Log Message:
Use uintptr_t instead of int when munging fcntl flags, which are
pointer-sized integers. Now builds in a 64-bit world, might even work :-)


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/compat/irix/irix_fcntl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/irix/irix_fcntl.c
diff -u src/sys/compat/irix/irix_fcntl.c:1.26 src/sys/compat/irix/irix_fcntl.c:1.27
--- src/sys/compat/irix/irix_fcntl.c:1.26	Sun Jun 28 09:50:57 2009
+++ src/sys/compat/irix/irix_fcntl.c	Mon Aug 31 05:34:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: irix_fcntl.c,v 1.26 2009/06/28 09:50:57 tsutsui Exp $ */
+/*	$NetBSD: irix_fcntl.c,v 1.27 2009/08/31 05:34:16 dholland Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.26 2009/06/28 09:50:57 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.27 2009/08/31 05:34:16 dholland Exp $");
 
 #include <sys/types.h>
 #include <sys/signal.h>
@@ -62,8 +62,8 @@
 #include <compat/svr4/svr4_syscallargs.h>
 
 static int fd_truncate(struct lwp *, int, int, off_t, register_t *);
-static int bsd_to_irix_fcntl_flags(int);
-static int irix_to_bsd_fcntl_flags(int);
+static uintptr_t bsd_to_irix_fcntl_flags(uintptr_t);
+static uintptr_t irix_to_bsd_fcntl_flags(uintptr_t);
 
 int
 irix_sys_lseek64(struct lwp *l, const struct irix_sys_lseek64_args *uap, register_t *retval)
@@ -161,12 +161,12 @@
 		 * All unsupported flags are silently ignored
 		 * except FDIRECT taht will return EINVAL
 		 */
-		if ((int)SCARG(uap, arg) & IRIX_FDIRECT)
+		if ((uintptr_t)SCARG(uap, arg) & IRIX_FDIRECT)
 			return EINVAL;
 
 		SCARG(&bsd_ua, fd) = SCARG(uap, fd);
 		SCARG(&bsd_ua, arg) =
-		    (char *)irix_to_bsd_fcntl_flags((int)SCARG(uap, arg));
+		    (char *)irix_to_bsd_fcntl_flags((uintptr_t)SCARG(uap, arg));
 		SCARG(&bsd_ua, cmd) = F_SETFL;
 		return sys_fcntl(l, &bsd_ua, retval);
 		break;
@@ -329,10 +329,10 @@
 	return 0;
 }
 
-static int
-irix_to_bsd_fcntl_flags(int flags)
+static uintptr_t
+irix_to_bsd_fcntl_flags(uintptr_t flags)
 {
-	int ret = 0;
+	uintptr_t ret = 0;
 
 	if (flags & IRIX_FNDELAY) ret |= FNDELAY;
 	if (flags & IRIX_FAPPEND) ret |= FAPPEND;
@@ -355,10 +355,10 @@
 	return ret;
 }
 
-static int
-bsd_to_irix_fcntl_flags(int flags)
+static uintptr_t
+bsd_to_irix_fcntl_flags(uintptr_t flags)
 {
-	int ret = 0;
+	uintptr_t ret = 0;
 
 	if (flags & FNDELAY) ret |= IRIX_FNDELAY;
 	if (flags & FAPPEND) ret |= IRIX_FAPPEND;

Reply via email to